All times are UTC - 6 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Oct 14, 2011 11:11 am 
Offline


Sun Sep 18, 2011 4:39 am

6
Hi Guys!

Did anybody came across a shell-way to alter the backlight intensity usally controlled with the F8 and F9 keys ?

I did take a look at the xmodmap and identified the XF86KbdBrightnessUp/Down event. But i don't have enough insight into xserver architecture to know where the event is handled. Does anybody have a hint ?

cheers,
Julian


Top
 Profile  
 
 Post subject: xdotool
PostPosted: Fri Oct 14, 2011 5:09 pm 
Offline


Thu Mar 10, 2011 9:48 pm

13
You could "cheat" and use xdotool to fake a keypress.

edit: Wait a sec... are you trying to adjust screen brightness without x running? xdotool will certainly only apply if you're running x.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 28, 2012 6:45 pm 
Offline


Tue Apr 17, 2012 3:15 am

44

Barcelona, Spain
I'm sort of necrobumping here but I was trying to figure this out too and I've found that you can do it by writing a numeric value to /sys/class/backlight/pwm-backlight/brightness (keep in mind the max value set in the max_brightness file in the same folder).

I created two simple Bash scripts for raising and lowering the brightness via this file. I then bound the brightness keys to call those scripts when I press them (in dwm). The downside to this is that you have to change permissions on that brightness file to be writable by your normal user. Can anyone think of a safer option than that?

Edit: nevermind this solution, use mchack's solution below!


Last edited by jakobcreutzfeldt on Tue Dec 04, 2012 4:31 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 29, 2012 3:07 am 
Offline


Tue Apr 17, 2012 3:15 am

44

Barcelona, Spain
The file permissions don't survive a reboot. To make the changes permanent, add the following line to your /etc/rc.local:
Code:
chmod 666 /sys/class/backlight/pwm-backlight/brightness


*edit*: permissions should be 666, not 777 (no need to execute the file)


Top
 Profile  
 
PostPosted: Wed May 02, 2012 6:17 am 
Offline


Wed May 02, 2012 2:12 am

1

Malmö, Sweden
julian wrote:
Hi Guys!

Did anybody came across a shell-way to alter the backlight intensity usally controlled with the F8 and F9 keys ?


I wrote a trivial C program to handle brightness from the shell:

http://hack.org/mc/hacks/bright.c

It works without X as well.

Note, though, that you that it needs to be setuid root.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group