dialect-app / dialect

A translation app for GNOME.
https://dialectapp.org/
GNU General Public License v3.0
609 stars 69 forks source link

Translate selected text with shortcut #207

Closed Alexios13 closed 3 years ago

Alexios13 commented 3 years ago

Is it ease to add a shortcut that open dialect and translate the selected text? Crow-translate has this future and it's very helpful. I select a text with my cursor, I press Ctrl + Alt + E and the crow-translate open with the text already translated. So there will be no need to copy and paste the text each time to the dialect.

2021-09-28_17-18

mufeedali commented 3 years ago

A proper implementation for this is impossible from our side in Wayland. You could, however, make use of Dialect's "-t" commandline parameter to create your own script and link a shortcut to it.

Alexios13 commented 3 years ago

I didn't know that this is not possible on Weyland. Thank you!

mufeedali commented 3 years ago

You're welcome :)

Like I said, though, as far as a user is concerned, it's still possible. You just need to setup a command to launch Dialect with the primary clipboard content passed in "-t". A tool you can use for that is wl-clipboard. The command could be like:

dialect -t "$(wl-paste -p)"

It should work.