I wrote two custom scripts to brighten/dim my screen and want to bind them to my F9 and F10 keys.
I put them into
/opt/bin and used
sudo chown root:root script and
sudo chmod 755 script on both and they work when called from the terminal.
When I now try to run
xbindkeys -v, with these lines added to
"/opt/bin/dim_screen.sh" Control + c:75 "/opt/bin/brighten_screen.sh" Control + c:76
it gives me this error message:
displayName = :0.0 rc file = /home/pi/.xbindkeysrc rc guile file = /home/pi/.xbindkeysrc.scm getting rc guile file /home/pi/.xbindkeysrc.scm. WARNING : /home/pi/.xbindkeysrc.scm not found or reading not allowed. 2 keys in /home/pi/.xbindkeysrc min_keycode=8 max_keycode=255 (ie: know keycodes) "/opt/bin/dim_screen.sh" m:0x4 + c:75 Control + F9 "/opt/bin/brighten_screen.sh" m:0x4 + c:76 X Error of failed request: BadAccess (attempt to access private resource denied) Major opcode of failed request: 33 (X_GrabKey) Serial number of failed request: 17 Current serial number in output stream: 21
At first I thought its about the file permissions of the scripts, thus I added
ALL ALL= NOPASSWD: /opt/bin/brighten_screen.sh ALL ALL= NOPASSWD: /opt/bin/dim_screen.sh
/etc/sudoers. But the error persisted, so I read it again and now after reading about xgrabkeys I think the key signals are already in use by some other program when xbindkeys wants to read them, so that it can't access them.
It also won't work when I don't use Function Keys.
Because it may well be that F9 and F10 are reserved for internal purposes I changed the
xmodmap mapping of F9 to F13 and of F10 to F14
I could temporarily make it work, by following the instructions by Vincent Yu on the Question "Using xbindkeys to bind the meta key (a.k.a. super key / Windows key) to left click and allow drag and drop" (I noticed what he said about the changes not being persistent through sessions) but now after reboot it gives me the same error again (with
F13), even though i ran
xmodmap -e 'keycode 75 = F13' and
xmodmap -e 'keycode 76 = F14' respectively and changed my
I don't know how to handle that or find out what blocks xbindkeys from using the keys. Google didn't give me helpful results and a glance over the posts on unix.SE (with exception of the aforementioned one) didn't help, either.
I use the Raspbian Jesse core with lxde if thats relevant.