Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:guides:xbindkeys [2014/06/21 14:53] – removed sidini | en:guides:xbindkeys [2020/09/23 16:14] (current) – [Adding xbindkeys in autostarted applications] hgt | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ---- | ||
| + | |||
| + | ====== Xbindkeys ====== | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | |||
| + | Xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X Windows. It links commands to keys or mouse buttons using a configuration file. It's independent of the window manager and can capture all keyboard keys (ex: Power, Wake...). | ||
| + | |||
| + | It is handy to make "dead keys" of a multimedia keyboard work. (ex: play, pause, browser homepage...) | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Installing ===== | ||
| + | |||
| + | Use //tazpkg// to quickly install // | ||
| + | |||
| + | # tazpkg get-install xbindkeys | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Configuration and detecting key codes ===== | ||
| + | |||
| + | Xbindkeys uses a configuration file to link a command to a key on your keyboard. Usually this file is : '' | ||
| + | |||
| + | You can have a default one created by using : | ||
| + | |||
| + | $ xbindkeys --defaults > $HOME/ | ||
| + | |||
| + | Start the program using: | ||
| + | |||
| + | $ xbindkeys | ||
| + | |||
| + | To add a custom keyboard shortcut, first you have to detect the key code. To do this, use: | ||
| + | |||
| + | $ xbindkeys -k | ||
| + | |||
| + | When a small white window shows up on screen, just press the desired key. Terminal will show you the 3-line code of the pressed key. Example: | ||
| + | |||
| + | " | ||
| + | m:0x10 + c:180 | ||
| + | Mod2 + XF86HomePage | ||
| + | |||
| + | Now, close '' | ||
| + | |||
| + | $ killall xbindkeys | ||
| + | |||
| + | Open '' | ||
| + | We need to change the first code line to link the key code to a desired function. For example, if we want to open Midori when '' | ||
| + | |||
| + | " | ||
| + | m:0x10 + c:180 | ||
| + | Mod2 + XF86HomePage | ||
| + | |||
| + | Save and close the '' | ||
| + | To add other shortcuts, repeat the procedure above. | ||
| + | |||
| + | If you want to detect a multi-key shortcut code like CTRL+F, use: | ||
| + | |||
| + | $ xbindkeys -mk | ||
| + | |||
| + | |||
| + | ==== Summary ==== | ||
| + | Summary of commands: | ||
| + | |||
| + | # tazpkg get-install xbindkeys | ||
| + | $ xbindkeys --defaults > $HOME/ | ||
| + | $ xbindkeys | ||
| + | $ xbindkeys -k | ||
| + | $ killall xbindkeys | ||
| + | $ leafpad HOME/ | ||
| + | $ xbindkeys | ||
| + | |||
| + | ==== Adding xbindkeys in autostarted applications ==== | ||
| + | |||
| + | In the **PCManFM** in your **home** folder search for hidden folder **.config**, | ||
| + | |||
| + | # Fn Keys | ||
| + | xbindkeys & | ||
| + | |||
| + | Save and quit text editor. All custom shortcuts will stay after you reboot or switch off and on your machine. | ||
| + | |||
| + | To make this modification a global, edit ''/ | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== Examples and tips ===== | ||
| + | This section shows you many command codes ready to use. Key codes (last two of 3-line key code) may vary from keyboard to keyboard, so it's up to you to catch them using // | ||
| + | |||
| + | === Volume control (Alsa mixer) === | ||
| + | |||
| + | # | ||
| + | " | ||
| + | m:0x00 + c:121 | ||
| + | XF86AudioMute | ||
| + | |||
| + | #Volume up | ||
| + | " | ||
| + | m:0x0 + c:123 | ||
| + | XF86AudioRaiseVolume | ||
| + | |||
| + | #Volume down | ||
| + | " | ||
| + | m:0x0 + c:122 | ||
| + | XF86AudioLowerVolume | ||
| + | |||
| + | === Alsaplayer === | ||
| + | |||
| + | #stop alsaplayer | ||
| + | " | ||
| + | m:0x0 + c:172 | ||
| + | XF86AudioPlay | ||
| + | |||
| + | #next alsaplayer | ||
| + | " | ||
| + | m:0x0 + c:171 | ||
| + | XF86AudioNext | ||
| + | |||
| + | #previous alsaplayer" | ||
| + | " | ||
| + | m:0x0 + c:173 | ||
| + | XF86AudioPrev | ||
| + | |||
| + | === Midori Browser === | ||
| + | |||
| + | #Open Midori at Homepage | ||
| + | " | ||
| + | m:0x10 + c:180 | ||
| + | Mod2 + XF86HomePage | ||
| + | |||
| + | #Back for previous page | ||
| + | " | ||
| + | m:0x10 + c:166 | ||
| + | Mod2 + XF86Back | ||
| + | |||
| + | #Forward to next page | ||
| + | " | ||
| + | m:0x10 + c:167 | ||
| + | Mod2 + XF86Forward | ||
| + | |||
| + | #Stop loading current page | ||
| + | " | ||
| + | m:0x10 + c:136 | ||
| + | Mod2 + Cancel | ||
| + | |||
| + | # | ||
| + | " | ||
| + | m:0x10 + c:181 | ||
| + | Mod2 + XF86Reload | ||
| + | |||
| + | NOTES: If you use Firefox or Google Chrome, there' | ||
| + | Also, if you change from Midori to Firefox or Chrome, you must comment (#) or delete the shortcuts above. If you don't do this, it will open a Midori window when you press a navigation button. | ||
| + | |||
| + | === Power management === | ||
| + | |||
| + | #suspend to ram | ||
| + | "sudo pm-suspend" | ||
| + | m:0x0 + c:150 | ||
| + | XF86Sleep | ||
| + | |||
| + | NOTE: this one (suspend to ram) works if you install // | ||
| + | |||
| + | #power off button | ||
| + | " | ||
| + | m:0x0 + c:124 | ||
| + | XF86PowerOff | ||
| + | |||
| + | === Screenshots === | ||
| + | |||
| + | #screenshot | ||
| + | " | ||
| + | m:0x0 + c:107 | ||
| + | |||
| + | |||
| + | === Applications Menu (Start Menu) === | ||
| + | |||
| + | #Show Start Menu with left windows-key | ||
| + | " | ||
| + | m:0x50 + c:133 | ||
| + | Mod2+Mod4 + Super_L | ||
| + | |||
| + | #Show Start Menu with right windows-key | ||
| + | " | ||
| + | m:0x50 + c:134 | ||
| + | Mod2+Mod4 + Super_R | ||
| + | |||
| + | ---- | ||
| + | |||
| + | ===== References ===== | ||
| + | |||
| + | Xbindkeys homepage: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | Forum topics: | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | http:// | ||
| + | |||
| + | |||
| + | ---- | ||
| + | \\ | ||
| + | ^ Page Review Section | ||
| + | |Quality| | ||
| + | |Review| | ||
| + | |Priority| | ||
| + | |Problems| | | ||
| + | |How to Improve| Add new rows like this ;-)| | ||
| + | |||
| + | |||
| + | \\ | ||