A shortcut is what differentiate the expert from the dilettante, the genius from the laborious. Even the expert has to go through the long way home, occasionally, but their routine practice of the Art will take all the possible shortcuts.
I use keyboard shortcuts a lot, for instance, lw in krunner brings me to this web (like wp does for wikipedia or gg for google). This you can get with in Web Shortcuts (best defined from konqueror):
http://laussy.org/wiki/Special:Search?search=\{@}&go=Go
The "Compose key" allows to fast-track some useful keys, e.g.:
Compose SPC SPC → Unbreakable space Compose - > → rightarrow
Definitions are typically in the file:
/usr/share/X11/locale/en_US.UTF-8/Compose
I use the right-most ctrl key as the Compose. It can be set as:
setxkbmap -option compose:rctrl
or, permanently in /etc/default/keyboard:
XKBMODEL="pc105" XKBLAYOUT="fr" XKBVARIANT="" BACKSPACE="guess" XKBOPTIONS="compose:rctrl"
In principle you can have a local ~/.XCompose file be read, first do:
export GTK_IM_MODULE=xim export QT_IM_MODULE=xim export XMODIFIERS=@im=xim
to export. But this doesn't seem to work.
For general keyboard shortcuts, I use keymapper. It seems that xkeysnail is also good.
The file to define the shortcuts is in ~/.config/keymapper.conf. The application runs with keymapper -u (where -u is for updating the rules from the file). Importantly: the keyboard in this file is assumed QWERTY, so use 'A' for 'Q', etc.
keymapperd is the privileged daemon that grabs /dev/uinput. There is also [email protected] which is the user-level client that actually parses ~/.config/keymapper.conf and pushes the mappings to the daemon. If the latter hangs, the daemon sits idle waiting for a client connection while keystrokes passed through unmapped. In this case:
systemctl --user status [email protected]
If it shows inactive (dead) with code=killed, just restart it:
systemctl --user restart [email protected]
Only restart keymapperd itself (sudo systemctl restart keymapperd) if that one is also dead or shows errors: check with systemctl status keymapperd and journalctl -u keymapperd.
To kill the key-mapping:
sudo pkill -f keymapperd pkill -f keymapper
and restart it: (use -v for both to have verbose output)
sudo keymapperd & keymapper&
Limitations:
I didn't figure out how to write outputs from programs, e.g., the current date (it doesn't understand /dev/tty or /dev/stdout, though it can output to tty but that's for terminals only). This should be possible with xdotool below:
Its shortcuts are listed in its dedicated page. Here are some legacy ones (obsolete, kept here for illustration):
My aliases are defined in ~/.bash_aliases and include (ll is for laussy-laussy):
alias lls='sudo updatedb'
Actually, lls is slightly more elaborate (outputs information, time taken and relies on sudoer) powered by bash functions lls(){} but this is the idea.
xdotool is a computer program to simulate input devices, e.g., the keyboard or the mouse.
For instance, entering the following in a console
xdotool click 2
simulates the mouse middle-click, which is typically associated to paste from last selected content. So from adding this as a new command in shortcuts in KDE's System Settings, one can emulate mapping the middle-click button to a keyboard key (in my case Ctrl+Shift+V)