As an Ubuntu 13.04 user I had myself as well various problems and incompatibilities with this newest version of Ubuntu. One of these is that the Brightness bar has suddenly disappeared from the 'System Settings --> Brightness & Lock' tab after I installed some packages (which I don't really remember what it was). I found out that a workaround is to use xbacklight.

As an exercise for myself, I wrote a short script in order to easily increase and decrease the brightness using xbacklight from terminal. The script is executable (has permission to execute), is an a directory that is included in $PATH in my .bashrc file and is linked to an alias ('blup' to increase and 'bldn' to decrease screen brightness). So, my two aliases (blup/bldn) work perfectly fine from a terminal line. Next, I wanted to link these to some keyboard shortcuts (for instance F2/F3). I did so in 'System Settings --> Keyboard --> Shortcuts --> Custom Shortcuts', but it did not work.

enter image description here


Furthermore, is there a way to 'discover' where and how other (non-custom) keyboard-shortcut commands are executed? For instance, the volume-up shortcut what terminal line does it execute, what alias is connected to (if any) and what directory are they put at (/usr/bin, something else...)?

As a newbie in script-writing I would appreciate any kind of help!


P.S.1 Of course, simply one can paste the command 'xbacklight -inc/-dec 10' to the custom keyboard shortcuts and it will work fine. I just want to seize the opportunity and get to know a bit more about script writing and executing.

P.S.2 My problem is not the same as this one: How do I launch a bash script using a keyboard shortcut?, ie, I use no '~/' for '/home/user/'.

  • This might help you askubuntu.com/questions/254424/…
    – Seth
    Jul 30, 2013 at 4:02
  • If you changed PATH in .bashrc, that change will only be available in interactive bash sessions; it will not be visible to the process doing the keyboard shortcuts. Change the PATH in ~/.profile instead, then log out and back in.
    – geirha
    Jul 30, 2013 at 7:22
  • I have tried to add the path where my scripts sit to the .profile, as you suggested, using either: PATH=$PATH:/home/myusername/scripts or export PATH=$PATH:/home/myusername/scripts but none of them worked (after logging in and out). However, if I add the full path of the script to the keyboard-shortcut (sh /home/username/script/nameofscript.sh) it does work. What am I doing wrong here?
    – mariotoss
    Jul 30, 2013 at 8:19

1 Answer 1


First of all, aliases are not expanded in non-interactive shells. Read the ALIASES section from man bash in this sense. So, you can't use an alias in 'Command' field when you add/edit a custom shortcut.

Second, as geirha said in this comment, if you changed PATH in .bashrc file, that change will not be available in non-interactive shells. So, you need to change the PATH in ~/.profile file instead.

Third, if you still want to use only bldn in 'Command' field when you add/edit a custom shortcut, you can rename your script with this name and add the script path to the PATH in ~/.profile file, as I said above.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.