tag:blogger.com,1999:blog-28645193.post2180068651206679620..comments2024-01-02T13:43:52.659+05:30Comments on manki’s weblog: More Linux fun: screen brightnessMankihttp://www.blogger.com/profile/01719555448858778552noreply@blogger.comBlogger23125tag:blogger.com,1999:blog-28645193.post-40451126909258155992011-11-06T13:18:15.394+05:302011-11-06T13:18:15.394+05:30I`m with Lubuntu (kernel 3.0.x) on Vostro 3350 w h...I`m with Lubuntu (kernel 3.0.x) on Vostro 3350 w hybrid GFX(ATI+Sandy). So i have: /sys/class/backlight/acpi_video1/brightness - for SandyBr. GFX and <br />/sys/class/backlight/acpi_video0/brightness - for ATI<br />and /sys/class/backlight/intel_backlight/brightness - which does nothing.<br />Since I didn`t manage to setup GFX switching properly(yet), I use acpi_call module to disable ATI on startup to save power & fan noise. <br />I checked the scripts - it works, when i change acpi_video0 to acpi_video1, thanks - it gives me idea how it works, but xbacklight utility mentioned above is the general solution for me.Gelehttp://lonebrain.netnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-64101333048896402712011-10-28T07:14:21.505+05:302011-10-28T07:14:21.505+05:30Thanks, it work's great.
You can modify your C...Thanks, it work's great.<br />You can modify your C source code to:<br /><br /><br />/*<br /> * Change/query the brightness of LCD screen.<br /> */<br /><br />#include <br /><br />int main(int argc, char *argv[])<br />{<br /> FILE *fp;<br /> int bright = 0;<br /> const char *kFileName = "/sys/class/backlight/dell_backlight/brightness";<br /><br /> fp = fopen(kFileName, "r");<br /> fscanf(fp, "%d", &bright);<br /> fclose(fp);<br /><br /> switch (argc) {<br /> case 1:<br /> printf("%d\n", bright);<br /> break;<br /> case 2:<br /> fp = fopen(kFileName, "w");<br /> bright += atoi(argv[1]);<br /> fprintf(fp, "%d\n", bright);<br /> fclose(fp);<br /> break;<br /> default:<br /> fprintf(stderr, "Usage: lcd-brightness [value]\n");<br /> return -1;<br /> }<br /><br /> return 0;<br />}<br /><br /><br />Now, you don't have to create 2 more scripts to increase/decrease - just type:<br />lcd-brigthness +[number] - to increase by number<br />lcd-brigthness -[number] - to decrease by number<br />lcd-brigthness - to print the current number<br /><br />(Of course correct the path to the brightness file so it will match yours and make sure to set the write chmode)Wojciechnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-14422455631638816972011-09-01T14:05:41.257+05:302011-09-01T14:05:41.257+05:30Thanks Royzz. Thanks zerosk8. :)Thanks Royzz. Thanks zerosk8. :)Mankihttps://www.blogger.com/profile/01719555448858778552noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-73112035207726088672011-09-01T12:46:05.317+05:302011-09-01T12:46:05.317+05:30Awesome post dude!
It just works perfectly! :D
You...Awesome post dude!<br />It just works perfectly! :D<br />You have no idea how badly I have been asking for something like this for ages! :D<br />Thanks a ton. :DRoyzzhttps://www.blogger.com/profile/01265514550269113694noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-12381156318665027952011-01-29T04:57:39.079+05:302011-01-29T04:57:39.079+05:30I was looking for a way to change the LCD brightne...I was looking for a way to change the LCD brightness on startup with my script, and google showed me this post.<br /><br />First, I tryed to modify /sys/class/backlight/acpi_video0/brightness, but it was so annoying to sudo echa time.<br /><br />Finally, just discovered an app for CLI that lets you change the brightness in a very easy way (and no need of superuser permissions!).<br /><br />The app is: xbacklight<br />Using it: xbacklight -set number<br /><br />number, an integer between 0 and 100<br /><br />;)Laliu M.https://www.blogger.com/profile/16074217873822506108noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-76560865714511038232010-10-14T12:06:42.379+05:302010-10-14T12:06:42.379+05:30I consider, that you are mistaken. I can defend th...I consider, that you are mistaken. I can defend the position. Write to me in PM.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-57954406798550241982009-12-11T16:56:03.756+05:302009-12-11T16:56:03.756+05:30@Anonymous: whoa, you've made my day. Thank Y...@Anonymous: whoa, you've made my day. Thank You!Mankihttps://www.blogger.com/profile/01719555448858778552noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-82916559525232392142009-12-11T16:46:41.487+05:302009-12-11T16:46:41.487+05:30Hi!!! mankikannan.blogspot.com is one of the best ...Hi!!! mankikannan.blogspot.com is one of the best innovative websites of its kind. I enjoy reading it every day. I will be back.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-8339216508992176132009-01-14T03:52:00.000+05:302009-01-14T03:52:00.000+05:30I think my problem is that I'm using an older vers...I think my problem is that I'm using an older version of redhat which didn't support acpi.<BR/><BR/>Thanks any way guys,Suhib Rawshdehhttps://www.blogger.com/profile/11921676744654288541noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-47549836583337481922009-01-13T07:45:00.000+05:302009-01-13T07:45:00.000+05:30@Suhib Rawshdeh:It sounds very simple, but have yo...@Suhib Rawshdeh:<BR/><BR/>It sounds very simple, but have you tried a "locate brightness"? It might just return what you're looking for. (If you haven't used locate before, be sure to run "sudo updatedb" first.Sharnhttps://www.blogger.com/profile/15662931481051355997noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-64118101490094570092009-01-12T22:42:00.000+05:302009-01-12T22:42:00.000+05:30I see, but the problem is I don't have the video d...I see, but the problem is I don't have the video directory in "/proc/acpi/.." path!!?Suhib Rawshdehhttps://www.blogger.com/profile/11921676744654288541noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-23271190514213103532009-01-12T22:32:00.000+05:302009-01-12T22:32:00.000+05:30Hi Suhib,Is "/proc/acpi/video/VGA/LCD/brightness" ...Hi Suhib,<BR/><BR/>Is "/proc/acpi/video/VGA/LCD/brightness" what you're looking for? (I don't have a RedHat machine; a quick Google search seems to suggest this path. Hope this helps.)Mankihttps://www.blogger.com/profile/01719555448858778552noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-47721644978284240572009-01-12T22:18:00.000+05:302009-01-12T22:18:00.000+05:30Hi Manki, GuysI have the same problem, but with Re...Hi Manki, Guys<BR/><BR/>I have the same problem, but with Redhat 2.6.9, what confuses me now is that I couldn't find this brightness file in my system, I already tried sys/class/... but nothing there!, I also tried proc/acpi/... path; have read this in a comment posted above, but still nothing, any suggestion to solve this!:(<BR/>I only need to know the path of the brightness file in Redhat filesystem.<BR/><BR/>SuhibSuhib Rawshdehhttps://www.blogger.com/profile/11921676744654288541noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-19025914389779995022008-12-03T16:53:00.000+05:302008-12-03T16:53:00.000+05:30OK, it's name is gnome-power-manager... if everyon...OK, it's name is gnome-power-manager... if everyone would like to know. Very nice app :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-25609210596794827882008-12-03T16:48:00.000+05:302008-12-03T16:48:00.000+05:30There is very nice application in Ubuntu, which is...There is very nice application in Ubuntu, which is connected to these values in /sys filesystem and which show nice "progress bar" when user change its brightness.<BR/><BR/>Does someone know its name? I'd like to install that on my Debian. If you know, please let me know on my e-mail address, thanks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-30821461188505567812008-07-25T18:44:00.000+05:302008-07-25T18:44:00.000+05:30To avoid the prickly setuid business you can take ...To avoid the prickly setuid business you can take advantage of the fact that the acpid daemon runs as root. Just create an event file at /etc/acpi/events/Fn-PgUp that contains the following:<BR/><BR/>event=ibm/hotkey HKEY 00000080 00001012<BR/>action=/etc/acpi/Fn-PgUp.sh<BR/><BR/>And have your Fn-PgUp.sh change the brighness.<BR/><BR/>When you hit Fn-PgUp the acpi event "HKEY 00000080 00001012" is generated which is picked up and acted upon by acpid.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-57651477291829371602008-03-15T20:59:00.000+05:302008-03-15T20:59:00.000+05:30"Only thing is that to compile I had to include st..."<I>Only thing is that to compile I had to include stdlib.h</I>"<BR/><BR/>Ah, good catch. I didn't have all warnings enabled; so I didn't see the warning when I compiled. 'gcc -Wall' shows me the warning about atoi. Thanks Daniel!Mankihttps://www.blogger.com/profile/01719555448858778552noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-79073562895872635112008-03-15T20:40:00.000+05:302008-03-15T20:40:00.000+05:30Ok, after installing the C program like you instru...Ok, after installing the C program like you instructed, it worked. <BR/><BR/>Only thing is that to compile I had to include stdlib.h<BR/><BR/>and that's because of the atoi() function.<BR/><BR/>Thanks again.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-31008835062315344022008-03-09T14:03:00.000+05:302008-03-09T14:03:00.000+05:30Thanks a lot for the insight. I compiled the C pro...Thanks a lot for the insight. <BR/><BR/>I compiled the C program on my system. To change brightness level, it will only work sudo'ed, becaue the file it has to modify requires root privileges. How did you achieve making the C program work for a regular user (without sudo)? <BR/><BR/>Thanks in advance.<BR/><BR/>DanielAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-18344422048775692712008-03-03T10:55:00.000+05:302008-03-03T10:55:00.000+05:30This post helped me immensely. Thanks a ton for yo...This post helped me immensely. Thanks a ton for your code examples. I'm on a Gateway ML6721, which has irregular brightness settings.(12,25,37,50,62,75,87, and 100)<BR/><BR/>I built a pair of scripts to replace yours to use these variables. If there's anyone out there who would like such things, just send me an email or reply to this. I'll also upload the "lcd-brightness" all compiled, if that's all right with the author.Sharnhttps://www.blogger.com/profile/15662931481051355997noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-26101254333812955752008-02-11T07:08:00.000+05:302008-02-11T07:08:00.000+05:30I have been frustrated for a while trying to get s...I have been frustrated for a while trying to get screen brightness to work in my Dell Inspiron e1705. Your blog inspired me, and after locating the brightness file (for me it was /proc/acpi/video/VID/LCD/brightness), I wrote a simple script in C++ that had to look at the current value and modify it accordingly (my brightness file starts at 12 and goes in increments of 12 up to 84, then jumps to 100), assigned shortcuts, and voila! I couldn't be happier. Thanks for the idea!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-28645193.post-26634020366757075742008-01-23T05:38:00.000+05:302008-01-23T05:38:00.000+05:30Thank you very much. I did the same thing with m...Thank you very much. I did the same thing with my Sony Vaio, with the following changes:<BR/><BR/>1) The path is /sys/class/backlight/sony/brightness<BR/><BR/>2) The brightness steps from 1 to 7 by increments of 1, so I modified the shell scripts to use 1 instead of 10.<BR/><BR/>3) I use gnome, so I set shortcut keys using gconf-editor<BR/><BR/>Thanks for pointing the way!Anonymoushttps://www.blogger.com/profile/08503037207089125630noreply@blogger.comtag:blogger.com,1999:blog-28645193.post-50607139234667905462008-01-20T06:38:00.000+05:302008-01-20T06:38:00.000+05:30I was having trouble with my LCD until I read your...I was having trouble with my LCD until I read your page. Thanks for the incredibly clear and detailed explanation. I will now experiment with more customizations in Linux!Anonymousnoreply@blogger.com