gnome-shell-extension-dict icon indicating copy to clipboard operation
gnome-shell-extension-dict copied to clipboard

Hotkey activation

Open webmastak opened this issue 5 years ago • 16 comments

Is it possible to make a choice to activate the translation by a hot key and turn off the icon or by a hot key and icon?

webmastak avatar May 29 '19 00:05 webmastak

Do you means to use hot key to disable and enable the extension?

sunwxg avatar May 29 '19 00:05 sunwxg

I want to use the hot key to activate the translation of the selected text.

webmastak avatar May 29 '19 00:05 webmastak

Okay, I get it. Which hot key do you prefer to do this work?

sunwxg avatar May 29 '19 00:05 sunwxg

It is best to choose which keys to turn on.

webmastak avatar May 29 '19 00:05 webmastak

I think It's better to use same key to trigger on and off. Press once to turn on, then press again to turn off.

sunwxg avatar May 29 '19 00:05 sunwxg

I think It's better to use same key to trigger on and off. Press once to turn on, then press again to turn off.

All right.

But you me did not understand) Make it so that can set the hotkey which one wants to use.

webmastak avatar May 29 '19 00:05 webmastak

It's a little difficult to set hotkey manually. I prefer to use the fix hotkey, or select one hotkey from several hotkeys.

sunwxg avatar May 29 '19 00:05 sunwxg

You can try my another extension 'Switch Workspace'. In this extension, user can chose the hotkey from 4 hotkeys.

sunwxg avatar May 29 '19 01:05 sunwxg

In this extension for example, in the settings you can set the hot key yourself.

I'm not strong in the java script unfortunately, I would have done it myself, may be rummaging at leisure. ))

webmastak avatar May 29 '19 01:05 webmastak

Yes, in that extension we can define hotkey manually. You can see the code in prefs.js, almost 90% codes are for manually defining hotkeys. And you should consider many other things, one important is conflict with other hotkeys. If you can't consider all things, you will meet many bugs. So I prefer to use fix hotkey.

sunwxg avatar May 29 '19 01:05 sunwxg

You can simply write hotkeys to a constant? For example const HOTKEY = "<Super>z"; Who will need to change, he will climb and fix in the file.

webmastak avatar May 29 '19 01:05 webmastak

Yes, I can. If we use fix hotkey, we will define it in the code as that.

sunwxg avatar May 29 '19 01:05 sunwxg

Good

webmastak avatar May 29 '19 01:05 webmastak

New feature has been finished. You can get it from extensions.gnome.org . Now the default hotkey is Ctrl+Alt+j . If you want to change hotkey, do as follow:

gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]@gmail.com/schemas get org.gnome.shell.extensions.dict hotkey
gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected]@gmail.com/schemas set org.gnome.shell.extensions.dict hotkey "<Control><Shift>j"

sunwxg avatar May 30 '19 01:05 sunwxg

Thank

webmastak avatar May 30 '19 01:05 webmastak

But you still do not understand me))) Hotkeys do not enable / disable the extension. Hot keys need to activate the window translation. And when you activate text translation with hotkeys, disable the pop-up icon.

And when you add your web address to the translation, Google for example. An empty window opens! https://translate.google.ru/?sl=auto&tl=ru&text=%WORD

So the perfect solution for me remains - Text Translator

webmastak avatar May 30 '19 19:05 webmastak