I want to know the technique of making custom keyboard-shortcuts to open or create any app.
Asked
Active
Viewed 1,182 times
1 Answers
3
Requirements
App or command
Install all of these like sudo apt install wmctrl
- xprob
- greb
- wmctrl
Information
WM_CLASS info of the app.
Instructions
Creating WM_CLASS for any app
To do this, you need to make desktop app.
- Type
sudo -H gedit /usr/share/applications/<appname>.desktop - And fill these section what you want to do, I suggest you to look these post
#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Appname
GenericName=Appname
Comment=
Exec=
Terminal=false
Type=Application
StartupNotify=true
MimeType=text/plain;
Icon=
Categories=
Keywords=
X-Ubuntu-Gettext-Domain=
StartupWMClass=
Getting WM_CLASS of any app
- First type terminal to find
WM_CLASSof any appxprop | grep WM_CLASS - After ENTER, click the app, which you want to make shortcut for
- You will see a return like
WM_CLASS(STRING) = "gnome-terminal-server", "Gnome-terminal" - Copy first string which is
gnome-terminal-serverwith CTRL + SHIFT + C
Making shortcut
- Open shortcuts with typing
shortcutto search panel - Click
+icon the bottom of the opened window - Set any name which u want to name section
- Type
bash -c "wmctrl -xa <wm_class> || <wm_class>to command section - Finally, click shortcut and set your custom shortcut :)
yEmreAk.com
- 1,339