Difference between revisions of "Playing with xbindkeys"

From Free Knowledge Base- The DUCK Project: information for everyone
Jump to: navigation, search
(Created page with " sudo apt-get install xbindkeys sudo apt-get install xautomation xautomation is needed for xte xbindkeys starts when the system starts. a reboot loads the new configura...")
 
m
 
(3 intermediate revisions by one user not shown)
Line 4: Line 4:
 
  sudo apt-get install xbindkeys
 
  sudo apt-get install xbindkeys
 
  sudo apt-get install xautomation
 
  sudo apt-get install xautomation
 +
sudo apt-get install xvkbd
  
xautomation is needed for xte
+
* xautomation is needed for xte
 +
* typing text xvkbd: utility the actually does the "typing"
  
 
xbindkeys starts when the system starts.  a reboot loads the new configuration out of .xbindkeysrc
 
xbindkeys starts when the system starts.  a reboot loads the new configuration out of .xbindkeysrc
  
 +
It is supposed to be possible to kill and restart the xbindkeys dameon with:
 +
killall xbindkeys && xbindkeys
 +
* restarts xbindkeys on xterm non-priv user
 +
* will not restart xbindkeys from remote shell (makes sense, it is tied to the xterm)
 +
 +
Stop the daemom:
 
  pkill -f xbindkeys
 
  pkill -f xbindkeys
  
Line 18: Line 26:
  
 
The n means nodaemon.  You can see xbindkeys errors when testing your .xbindkeysrc file.
 
The n means nodaemon.  You can see xbindkeys errors when testing your .xbindkeysrc file.
 +
 +
Launch Firefox with Ctrl + f
 +
"firefox"
 +
  control + f
 +
 +
Launch xterm when mouse button 3 is clicked
 +
"xterm"
 +
  b:3
 +
 +
The first mouse button (left) is called b:1, the second (right) b:3
 +
 +
xte can also be used to simulate mouse clicks. Below is an example.
 +
 +
"xte 'mouseclick 1' 'keydown Control_L' 'key v' 'keyup Control_L' 'key F2'"
 +
b:2 + Release
 +
 +
----
 +
 +
* Example: Press F1 will play a sound and simulate a left mouse click/release
 +
"xte 'mouseclick 1' & /usr/bin/aplay ~/leftclick.wav"
 +
m:0x10 + c:67
 +
 +
=== Auto start xbindkeys ===
 +
The file
 +
/etc/X11/Xsession.d/98xbindkeys
 +
is created when you install xbindkeys.
 +
 +
xbindkeys is automatically started if you have an .xbindkeysrc in your home directory or in a system directoryt such as /etc
 +
 +
In 98xbindkeys you can find it starts xbindkeys if he user (or system) has a config for it AND does NOT Have a .xbindkeys.noauto in his homedir.
 +
 +
If you place a file named ".xbindkeys.noauto" in your home directory then xbindkeys won't automatically start up with your x session.
 +
touch ~/.xbindkeys.noauto
 +
 +
=== related pages ===
 +
 +
* [[Multimedia Key Mapping in Mythbuntu using xmodmap]]
 +
* [[Playing with xbindkeys]]
 +
* [[Multimedia Keys]]
 +
* [[USB Device Diagnostics in Linux]]

Latest revision as of 20:08, 28 February 2019


sudo apt-get install xbindkeys
sudo apt-get install xautomation
sudo apt-get install xvkbd
  • xautomation is needed for xte
  • typing text xvkbd: utility the actually does the "typing"

xbindkeys starts when the system starts. a reboot loads the new configuration out of .xbindkeysrc

It is supposed to be possible to kill and restart the xbindkeys dameon with:

killall xbindkeys && xbindkeys
  • restarts xbindkeys on xterm non-priv user
  • will not restart xbindkeys from remote shell (makes sense, it is tied to the xterm)

Stop the daemom:

pkill -f xbindkeys

now the xbindkeys daemon has stopped.

from the xconsole type:

xbindkeys -n

The n means nodaemon. You can see xbindkeys errors when testing your .xbindkeysrc file.

Launch Firefox with Ctrl + f

"firefox"
 control + f

Launch xterm when mouse button 3 is clicked

"xterm"
 b:3

The first mouse button (left) is called b:1, the second (right) b:3

xte can also be used to simulate mouse clicks. Below is an example.

"xte 'mouseclick 1' 'keydown Control_L' 'key v' 'keyup Control_L' 'key F2'"
b:2 + Release

  • Example: Press F1 will play a sound and simulate a left mouse click/release
"xte 'mouseclick 1' & /usr/bin/aplay ~/leftclick.wav"
m:0x10 + c:67

Auto start xbindkeys

The file

/etc/X11/Xsession.d/98xbindkeys

is created when you install xbindkeys.

xbindkeys is automatically started if you have an .xbindkeysrc in your home directory or in a system directoryt such as /etc

In 98xbindkeys you can find it starts xbindkeys if he user (or system) has a config for it AND does NOT Have a .xbindkeys.noauto in his homedir.

If you place a file named ".xbindkeys.noauto" in your home directory then xbindkeys won't automatically start up with your x session.

touch ~/.xbindkeys.noauto

related pages