I have a macbook pro and I am in the process of binding scripts to control the backlight level on my keyboard. I wrote 2 scripts and they work perfectly I just cant get them to run on a keypress. I have xbindkeys set up and running with a configuration file named .xbindkeysrc in the configuration file I attempt to bind the scripts to my special function keys (same row as fn). I know my configuration file loads properly because when I run xbindkeys -s
it shows the two attempted bindings that are not currently working. Here is the contents of my.xbindkeysrc file
###########################
# xbindkeys configuration #
###########################
#
# Version: 0.1.3
#
# If you edit this, do not forget to uncomment any lines that you change.
# The pound(#) symbol may be used anywhere for comments.
#
# A list of keys is in /usr/include/X11/keysym.h and in
# /usr/include/X11/keysymdef.h
# The XK_ is not needed.
#
# List of modifier (on my keyboard):
# Control, Shift, Mod1 (Alt), Mod2 (NumLock),
# Mod3 (CapsLock), Mod4, Mod5 (Scroll).
#
# Another way to specifie a key is to use 'xev' and set the
# keycode with c:nnn or the modifier with m:nnn where nnn is
# the keycode or the state returned by xev
#
# This file is created by xbindkey_config
# The structure is :
# # Remark
# "command"
# m:xxx + c:xxx
# Shift+...
#keystate_numlock = enable
#keystate_scrolllock = enable
#keystate_capslock = enable
"bash /opt/keyLightInc.sh"
m:0x0 + c:238
XF86KbdBrightnessUp
"bash /opt/keyLightDec.sh"
m:0x0 + c:237
XF86KbdBrightnessDown
#
# End of xbindkeys configuration
I started it with the verbose option. Here is the output:
screen 0 for window 259
Start program with fork+exec call
sudo: no tty present and no askpass program specified
/etc/sudoers
for those scripts? Why are you calling them withsudo bash
? – jasonwryan Dec 21 '14 at 05:23bash
and just call the script? – jasonwryan Dec 21 '14 at 05:44#!/bin/sh
to the beginning of each file, now when I call the script it sayspermission denied
andsudo
before the script path results in the errorcommand not found
– xavier Dec 21 '14 at 06:03/opt/
in your PATH? – jasonwryan Dec 21 '14 at 06:07/opt/keyLightInc.sh
I edited my xbindkeys config file and relaunched xbindkeys. Still no luck. – xavier Dec 21 '14 at 06:17got screen 0 for window 259; Start program with fork+exec call; sudo: no tty present and no askpass program specified
– xavier Dec 21 '14 at 06:43