<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.2" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Adjust LCD brightness from command line</title>
	<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/</link>
	<description>Put the screw on Linux!</description>
	<pubDate>Tue, 14 Oct 2008 07:52:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.2</generator>

	<item>
		<title>By: Petko</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-20893</link>
		<author>Petko</author>
		<pubDate>Sat, 31 May 2008 09:11:44 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-20893</guid>
		<description>Hello. Here is another way to do this. I add in the file ~/.bashrc :

Bup ()
{
	FILE=/proc/acpi/video/VID/LCD/brightness
	current=`cat $FILE &#124; grep current &#124; cut -c 10-`
	prev=12
	for i in  `cat $FILE &#124; grep levels &#124; cut -c 17-`; do
		if [[ $i -eq $current &#38;&#38; "$1" == "-" ]]; then
			echo -n $prev &#62; $FILE
			break;
		elif [ $i -gt $current ]; then
			echo -n $i &#62; $FILE ;
			break;
		fi;
		prev=$i
	done
}
Bdown (){ Bup -; }

(Just make sure the line FILE=/proc/acpi/video/... points to your correct file.)
This way, I can type in a terminal "Bup" or "Bdown" to set the brightness up or down.

Greetings.</description>
		<content:encoded><![CDATA[<p>Hello. Here is another way to do this. I add in the file ~/.bashrc :</p>
<p>Bup ()<br />
{<br />
	FILE=/proc/acpi/video/VID/LCD/brightness<br />
	current=`cat $FILE | grep current | cut -c 10-`<br />
	prev=12<br />
	for i in  `cat $FILE | grep levels | cut -c 17-`; do<br />
		if [[ $i -eq $current &amp;&amp; "$1" == "-" ]]; then<br />
			echo -n $prev &gt; $FILE<br />
			break;<br />
		elif [ $i -gt $current ]; then<br />
			echo -n $i &gt; $FILE ;<br />
			break;<br />
		fi;<br />
		prev=$i<br />
	done<br />
}<br />
Bdown (){ Bup -; }</p>
<p>(Just make sure the line FILE=/proc/acpi/video/&#8230; points to your correct file.)<br />
This way, I can type in a terminal "Bup" or "Bdown" to set the brightness up or down.</p>
<p>Greetings.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3907</link>
		<author>Alex</author>
		<pubDate>Tue, 04 Mar 2008 04:14:29 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3907</guid>
		<description>The following is working nicely for me:
#!/bin/sh
# adjust lcd brightness on Dell Inspiron 1501 - 080303 Alex P Janssen Jr - alex@ourwoods.org
# INSTRUCTIONS: 
# Save this script to a file named brightup.sh in /home/yourusername/bin
# Make it executable: chmod +x brightup.sh
# Save yourself having to run it in a terminal and enter your password each time
# edit sudoers: sudo visudo
#    add to sudoers:  yourusername ALL=(ALL) NOPASSWD:/bin/bash
#    save and exit
# link brightup and brightdn to brightup.sh:
#    ln -s /home/yourusername/bin/brightup.sh /home/yourusername/bin/brightup
#    ln -s /home/yourusername/bin/brightup.sh /home/yourusername/bin/brightdn
# Add a couple of custum launchers to your panel ( I run Gnome )
#    Right-click the panel and select Add to Panel
#    Click Custom Launcher
#    Type=Application, Name=Darker, Command=sudo bash -c /home/apjjr/bin/brightdn
#    Select a down-arrow for an icon and Close
# Do the same for brightup, except set the name to Lighter and pick an up-arrow
#
# check our id
#echo `id`
ourname=$0
ourname=`basename "$ourname"`
xx=`cat /proc/acpi/video/VGA/LCD/brightness &#124; grep current &#124; cut -c 9-`
curbright=`echo $xx`
# check process name and current brightness setting
#echo "${ourname},${curbright}:"
case $curbright in
     0) # after boot my brightness value is 0
        # echo "12"
        echo -n 12 &#62;/proc/acpi/video/VGA/LCD/brightness
        ;;
    12) if [ "$ourname" = "brightup" ]; then
            #echo "12 to 25"
            echo -n 25 &#62;/proc/acpi/video/VGA/LCD/brightness 
        fi
        ;;
    25) if [ "$ourname" = "brightup" ]; then
            #echo "25 to 37"
            echo -n 37 &#62;/proc/acpi/video/VGA/LCD/brightness
        else
            echo -n 12 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
    37) if [ "$ourname" = "brightup" ]; then
            #echo "37 to 50"
            echo -n 50 &#62;/proc/acpi/video/VGA/LCD/brightness
        else
            echo -n 25 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
    50) if [ "$ourname" = "brightup" ]; then
            #echo "50 to 62"
            echo -n 62 &#62;/proc/acpi/video/VGA/LCD/brightness
        else
            echo -n 37 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
    62) if [ "$ourname" = "brightup" ]; then
            #echo "62 to 75"
            echo -n 75 &#62;/proc/acpi/video/VGA/LCD/brightness
        else
            echo -n 50 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
    75) if [ "$ourname" = "brightup" ]; then
            #echo "75 to 87"
            echo -n 87 &#62;/proc/acpi/video/VGA/LCD/brightness
        else
            echo -n 62 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
    87) if [ "$ourname" = "brightup" ]; then
            #echo "87 to 100"
            echo -n 100 &#62;/proc/acpi/video/VGA/LCD/brightness
        else
            echo -n 75 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
    100) if [ "$ourname" != "brightup" ]; then
            echo -n 87 &#62;/proc/acpi/video/VGA/LCD/brightness
        fi
        ;;
esac
exit 0

That's it.
Alex</description>
		<content:encoded><![CDATA[<p>The following is working nicely for me:<br />
#!/bin/sh<br />
# adjust lcd brightness on Dell Inspiron 1501 - 080303 Alex P Janssen Jr - <a href="mailto:alex@ourwoods.org">alex@ourwoods.org</a><br />
# INSTRUCTIONS:<br />
# Save this script to a file named brightup.sh in /home/yourusername/bin<br />
# Make it executable: chmod +x brightup.sh<br />
# Save yourself having to run it in a terminal and enter your password each time<br />
# edit sudoers: sudo visudo<br />
#    add to sudoers:  yourusername ALL=(ALL) NOPASSWD:/bin/bash<br />
#    save and exit<br />
# link brightup and brightdn to brightup.sh:<br />
#    ln -s /home/yourusername/bin/brightup.sh /home/yourusername/bin/brightup<br />
#    ln -s /home/yourusername/bin/brightup.sh /home/yourusername/bin/brightdn<br />
# Add a couple of custum launchers to your panel ( I run Gnome )<br />
#    Right-click the panel and select Add to Panel<br />
#    Click Custom Launcher<br />
#    Type=Application, Name=Darker, Command=sudo bash -c /home/apjjr/bin/brightdn<br />
#    Select a down-arrow for an icon and Close<br />
# Do the same for brightup, except set the name to Lighter and pick an up-arrow<br />
#<br />
# check our id<br />
#echo `id`<br />
ourname=$0<br />
ourname=`basename "$ourname"`<br />
xx=`cat /proc/acpi/video/VGA/LCD/brightness | grep current | cut -c 9-`<br />
curbright=`echo $xx`<br />
# check process name and current brightness setting<br />
#echo "${ourname},${curbright}:"<br />
case $curbright in<br />
     0) # after boot my brightness value is 0<br />
        # echo "12"<br />
        echo -n 12 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        ;;<br />
    12) if [ "$ourname" = "brightup" ]; then<br />
            #echo "12 to 25"<br />
            echo -n 25 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    25) if [ "$ourname" = "brightup" ]; then<br />
            #echo "25 to 37"<br />
            echo -n 37 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        else<br />
            echo -n 12 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    37) if [ "$ourname" = "brightup" ]; then<br />
            #echo "37 to 50"<br />
            echo -n 50 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        else<br />
            echo -n 25 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    50) if [ "$ourname" = "brightup" ]; then<br />
            #echo "50 to 62"<br />
            echo -n 62 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        else<br />
            echo -n 37 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    62) if [ "$ourname" = "brightup" ]; then<br />
            #echo "62 to 75"<br />
            echo -n 75 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        else<br />
            echo -n 50 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    75) if [ "$ourname" = "brightup" ]; then<br />
            #echo "75 to 87"<br />
            echo -n 87 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        else<br />
            echo -n 62 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    87) if [ "$ourname" = "brightup" ]; then<br />
            #echo "87 to 100"<br />
            echo -n 100 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        else<br />
            echo -n 75 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
    100) if [ "$ourname" != "brightup" ]; then<br />
            echo -n 87 &gt;/proc/acpi/video/VGA/LCD/brightness<br />
        fi<br />
        ;;<br />
esac<br />
exit 0</p>
<p>That&#8217;s it.<br />
Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3898</link>
		<author>Alex</author>
		<pubDate>Mon, 03 Mar 2008 04:04:02 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3898</guid>
		<description>Thanks for posting this info.  Every day, I learn something new about using linux.  Much more fun than M$ Win!
Seems to me this could easily be put in a script that would read the current setting and go up or down depending on which name it was called with.
I'm going to work on it for myself and post it back here in case anyone else is interested.
Can all of the hardware be controlled via the /proc dir?

Thanks again for the pointer. :-)</description>
		<content:encoded><![CDATA[<p>Thanks for posting this info.  Every day, I learn something new about using linux.  Much more fun than M$ Win!<br />
Seems to me this could easily be put in a script that would read the current setting and go up or down depending on which name it was called with.<br />
I'm going to work on it for myself and post it back here in case anyone else is interested.<br />
Can all of the hardware be controlled via the /proc dir?</p>
<p>Thanks again for the pointer. <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: animatt</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3774</link>
		<author>animatt</author>
		<pubDate>Sat, 23 Feb 2008 17:57:14 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3774</guid>
		<description>Try running cat /proc/acpi/video/VGA/LCD/brightness

This will show supported brightness levels.

Running it on my monitor gives  

root@Gateway-M-Series:/home/animatt# cat /proc/acpi/video/VGA/LCD/brightnesslevels:  100 37 12 25 37 50 62 75 87 100
current: 12</description>
		<content:encoded><![CDATA[<p>Try running cat /proc/acpi/video/VGA/LCD/brightness</p>
<p>This will show supported brightness levels.</p>
<p>Running it on my monitor gives  </p>
<p><a href="mailto:root@Gateway-M-Series:/home/animatt#">root@Gateway-M-Series:/home/animatt#</a> cat /proc/acpi/video/VGA/LCD/brightnesslevels:  100 37 12 25 37 50 62 75 87 100<br />
current: 12</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ross</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3677</link>
		<author>ross</author>
		<pubDate>Mon, 18 Feb 2008 18:02:33 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3677</guid>
		<description>it might only work on opensuse. when you do this kpowersave doesnt work</description>
		<content:encoded><![CDATA[<p>it might only work on opensuse. when you do this kpowersave doesnt work</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ross</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3676</link>
		<author>ross</author>
		<pubDate>Mon, 18 Feb 2008 18:01:21 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3676</guid>
		<description>turn off acpi and it will work with fn keys</description>
		<content:encoded><![CDATA[<p>turn off acpi and it will work with fn keys</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Satish Vellanki</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3419</link>
		<author>Satish Vellanki</author>
		<pubDate>Wed, 06 Feb 2008 06:55:11 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3419</guid>
		<description>No luck for me :-(

# echo -n 50 &#62; /proc/acpi/video/VGA/LCD/brightness 
bash: echo: write error: Invalid argument

What could be wrong?</description>
		<content:encoded><![CDATA[<p>No luck for me <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p># echo -n 50 &gt; /proc/acpi/video/VGA/LCD/brightness<br />
bash: echo: write error: Invalid argument</p>
<p>What could be wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: artiomix</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3170</link>
		<author>artiomix</author>
		<pubDate>Thu, 24 Jan 2008 20:28:02 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3170</guid>
		<description>Hello Rasha, 

try this:

&lt;code&gt;sudo -s&lt;/code&gt; or &lt;code&gt;su&lt;/code&gt;

then

&lt;code&gt;echo -n 100 &gt; /proc/acpi/video/VID/LCD/brightness&lt;/code&gt;

:D</description>
		<content:encoded><![CDATA[<p>Hello Rasha, </p>
<p>try this:</p>
<p><code>sudo -s</code> or <code>su</code></p>
<p>then</p>
<p><code>echo -n 100 > /proc/acpi/video/VID/LCD/brightness</code></p>
<p> <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rasha</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3168</link>
		<author>Rasha</author>
		<pubDate>Thu, 24 Jan 2008 15:56:59 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-3168</guid>
		<description>I have a Dell Latitude C610 and I've tried running the line in Ubuntu tho I had to modify as my line is /proc/acpi/video/VID/LCD/brightness. But it's saying the command is unknown.</description>
		<content:encoded><![CDATA[<p>I have a Dell Latitude C610 and I've tried running the line in Ubuntu tho I had to modify as my line is /proc/acpi/video/VID/LCD/brightness. But it&#8217;s saying the command is unknown.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: artiomix</title>
		<link>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-2632</link>
		<author>artiomix</author>
		<pubDate>Thu, 10 Jan 2008 21:50:04 +0000</pubDate>
		<guid>http://www.linuxscrew.com/2007/10/25/ajust-lcd-brightness-from-command-line-works-at-dell-1501/#comment-2632</guid>
		<description>Hey everybody, thanks for your comments! :)</description>
		<content:encoded><![CDATA[<p>Hey everybody, thanks for your comments! <img src='http://www.linuxscrew.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
