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 = enablebash /opt/keyLightInc.sh    m:0x0 + c:238    XF86KbdBrightnessUp bash /opt/keyLightDec.sh    m:0x0 + c:237    XF86KbdBrightnessDown ## End of xbindkeys configurationI started it with the verbose option. Here is the output:screen 0 for window 259Start program with fork+exec callsudo: no tty present and no askpass program specified
Call sudo from a script called by xbindkeys
sudo;xbindkeys
If your sudoers file sets the requiretty option, then you can only call sudo from a terminal.If your sudoers file doesn't set the requiretty option, then you can call sudo from anywhere, but if it prompts for a password, a terminal is required. The message sudo: no tty present and no askpass program specified indicates that sudo tried to prompt you for a password, but failed.You can pass the -A option to tell sudo to use a different method to prompt you for a password. Since you're running in X11, you can use the ssh-askpass program distributed with OpenSSH, which prompts for a password in an X11 window.sudo -A /usr/bin/ssh-askpass whatever-command-you-need-to-execute-as-rootAlternatively, allow yourself to run this program without entering a password.