Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
2  
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
add comment

2 Answers

Try xbindkeys.

Your ~/.xbindkeysrc would look something like

"myscript"
    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
1  
This is a simple configuration: nongnu.org/xbindkeys/xbindkeysrc_d –  AlexWebr Aug 5 '12 at 14:45
add comment

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
add comment

Your Answer

 
discard

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.