Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've written a script to change the brightness of my screen.

It's useful when I am working on text mode and shortcut keys of my keyboard to change brightness doesn't work.

Is it possible to run this script, just by pressing some keys on the keyboard as shortcut, for example Ctrl+Alt+F7?

share|improve this question
What do you mean by “on text mode”? Do you mean the text mode console (i.e. outside X Window)? On what operating system? – Gilles Aug 3 '12 at 22:28
up vote 6 down vote accepted

Try xbindkeys.

Your ~/.xbindkeysrc would look something like

    Control + Alt + F7
share|improve this answer
This is a great answer. xbindkeys is awesome. – AlexWebr Aug 3 '12 at 15:46
@AlexWebr, Mikel Yes, but it's for X, and I think the question is about doing this outside X. – Gilles Aug 3 '12 at 22:28
I'm not familiar with xbindkeysrc can you explain more? – M0εiπ Aug 5 '12 at 7:18
This is a simple configuration: nongnu.org/xbindkeys/xbindkeysrc_d – AlexWebr Aug 5 '12 at 14:45
I tried but it won't release the keys back to me. It acts like it still holds down Ctrl/Alt keys. I have to wait for ~5 seconds for it to release it back to me. – deppfx Aug 6 '15 at 5:18

If you're working in a terminal and don't have X running, a bit of a hack is to alias your script to a single character in your shell's configuration. Example for bash:

alias b='~/bin/brightness-script down'
alias B='~/bin/brightness-script up'

Disadvantage: you have to press Enter each time. Alternatively, you could do b;b;b;b;b[Enter] to step the brightness down 5 times.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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