Custom shortcuts with jumpapp in Ubuntu
Custom shortcuts in Ubuntu is a great way to speed up starting up programs, or focusing on them.
Jumpapp is a great tool to use together with custom shortcuts:
"The idea is simple — bind a key for any given application that will:
- launch the application, if it's not already running, or
- focus the application's window, if it is running
Pressing the key again will cycle to the application's next window, if there's more than one."
From: https://github.com/mkropat/jumpapp
Create Custom shortcuts here: Keyboard > Shortcuts > Custom Shortcuts, these are my custom shortcuts:
firefox
jumpapp firefox
Super+F
sublime text
jumpapp subl
Super+X
shutdown
gnome-session-quit --power-off
Ctrl+Alt+Delete
gnome-system-monitor
jumpapp gnome-system-monitor
Super+S
shutter
jumpapp shutter
Super+K
chromium
jumpapp chromium-browser
Super+H
nemo
jumpapp -f nemo /arkiv
Super+E
transmission
jumpapp -f transmission-gtk
Super+R
thunderbird
jumpapp thunderbird
Super+T
terminal
jumpapp gnome-terminal --window --maximize
onehalf
gimp
jumpapp gimp
Super+G
calculator
jumpapp gnome-calculator
Super+C
audacious
jumpapp -f audacious
Super+A
filezilla
jumpapp filezilla
Super+I
epiphany
jumpapp -f epiphany-browser
Super+W
baobab
jumpapp baobab
Super+B
opera
jumpapp opera --start-maximized
Super+Å
vivaldi
jumpapp vivaldi
Super+V
Trashcan
nemo trash://
Super+Alt+T
... and then empty trash with Alt+T.
Export and import Custom Shortcuts
You can save/backup/export custom shortcuts/keybindings with dconf and sed.
Export
dconf dump / | sed -n '/\[org.gnome.settings-daemon.plugins.media-keys/,/^$/p' > custom-shortcuts.ini
Import
dconf load / < custom-shortcuts.ini
Xbindkeys
Xbindkeys allows you to define your shortcuts in a file for quick back up and import. To install:
sudo apt install xbindkeys
Create a fresh file from template called .xbindkeysrc
with this command:
xbindkeys --defaults > ~/.xbindkeysrc
Add definitions, like these. Log out, for them to take effect:
"jumpapp firefox" mod4 + f "jumpapp subl" mod4 + x "jumpapp gimp" mod4 + g "jumpapp gnome-calculator" mod4 + c "jumpapp -f audacious" mod4 + a "jumpapp filezilla" mod4 + i "jumpapp -f epiphany-browser" mod4 + w "jumpapp opera --start-maximized" mod4 + aring "jumpapp vivaldi" mod4 + v "nemo trash://" alt + mod4 + t "jumpapp gnome-system-monitor" mod4 + s "jumpapp shutter" mod4 + k "jumpapp chromium-browser" mod4 + h "jumpapp -f nemo" mod4 + e "jumpapp -f transmission-gtk" mod4 + r "jumpapp thunderbird" mod4 + t "jumpapp gnome-terminal --window --maximize" m:0x10 + c:49
Find key values with xbindkeys -k
. mod4
equals Super key, found with xmodmap
.
Open overlay with either Super key using xcape
To make both left and right Super key initiate the “overlay”, which is a combination window overview and application launching system, you first need to open dconf and disable the /org/gnome/mutter/overlay-key
key, by deleting the content of "Custom value" and activating it.
Next, install xcape with sudo apt install xcape
, open "Startup Application Preferences" and add this (Note: Check under /org/gnome/desktop/wm/keybindings/panel-main-menu
that the value is indeed ['<Alt>F1']
):
Name: Xcape
Command: xcape -e 'Super_L=Alt_L|F1;Super_R=Alt_L|F1'
Comment: Bind both Super keys to Alt+F1 (open Overlay)
After restarting your computer, pressing either Super key should now open the overlay. This example starts out with only left Super key defined, restarting xcape adds the right Super key:
$ ps ax | grep xcape 17285 ? Ssl 0:00 xcape -e Super_L Alt_L F1 $ sudo kill -KILL 17285 $ ps ax | grep xcape 17285 ? Ssl 0:00 xcape -e Super_L Alt_L F1 Super_R Alt_L F1
For more, see:
https://gitlab.xfce.org/xfce/libxfce4ui/-/issues/1
https://askubuntu.com/questions/1091877/assign-super-key-for-show-applications
https://forum.xfce.org/viewtopic.php?id=12307