<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="http://crunchbang.org/forums/extern.php?action=feed&amp;type=rss&amp;tid=11954" rel="self" type="application/rss+xml" />
		<title><![CDATA[CrunchBang Linux Forums / Laptop power saving script for #! & Debian]]></title>
		<link>http://crunchbang.org/forums/viewtopic.php?id=11954</link>
		<description><![CDATA[The most recent posts in Laptop power saving script for #! & Debian.]]></description>
		<lastBuildDate>Tue, 05 Feb 2013 19:10:04 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287770#p287770</link>
			<description><![CDATA[<div class="quotebox"><cite>typewriterjason wrote:</cite><blockquote><div><p>Hey @el_koraco, when you said &#039;my version of the script,&#039; do you mean the 1st script posted by Hardan3, or Unia&#039;s script?</p></div></blockquote></div><p>I meant hardan&#039;s. </p><p>@Unia - pm-utils is installed by default in normal distros, so... <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/big_smile.png" alt="big_smile" /><br />wrt governors, I&#039;m getting 30 or 40 minutes more on powersave. This is all very unscientific, of course. I haven&#039;t tried the conservative governor, I&#039;m sticking to the &quot;if it&#039;s not broke&quot; philosophy here.</p>]]></description>
			<author><![CDATA[dummy@example.com (el_koraco)]]></author>
			<pubDate>Tue, 05 Feb 2013 19:10:04 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287770#p287770</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287749#p287749</link>
			<description><![CDATA[<div class="quotebox"><cite>el_koraco wrote:</cite><blockquote><div><p>I don&#039;t even think these things are necessary any more. Most of this stuff has been integrated into newer versions of pm-utils. fewt has even sopped Jupiter development. The only thing I do have in my version of the script that isn&#039;t present upstream is going on the powersave CPU governor on battery. Check /usr/lib/pm-utils for more details.</p></div></blockquote></div><p>True, I do not use pm-utils or any of its siblings so I came up with my own version. I do like the simplicity of my script over pm-utils.</p><p>Regarding the powersave governor, some say it&#039;s not as powersaving as its name suggests. I could come up with some links on the matter, but I have to go soon. Are you aware of those statements, el_K?</p>]]></description>
			<author><![CDATA[dummy@example.com (Unia)]]></author>
			<pubDate>Tue, 05 Feb 2013 18:16:56 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287749#p287749</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287730#p287730</link>
			<description><![CDATA[<p>I&#039;ve been wondering about that. I&#039;m running Waldorf, (not bleeding-edge versions, but still) and when I installed Hardan3&#039;s script, I didn&#039;t really notice a change. Maybe that&#039;s because of the pm-utils?</p><p>Hey @el_koraco, when you said &#039;my version of the script,&#039; do you mean the 1st script posted by Hardan3, or Unia&#039;s script?</p>]]></description>
			<author><![CDATA[dummy@example.com (typewriterjason)]]></author>
			<pubDate>Tue, 05 Feb 2013 17:02:51 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287730#p287730</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287729#p287729</link>
			<description><![CDATA[<p>I don&#039;t even think these things are necessary any more. Most of this stuff has been integrated into newer versions of pm-utils. fewt has even sopped Jupiter development. The only thing I do have in my version of the script that isn&#039;t present upstream is going on the powersave CPU governor on battery. Check /usr/lib/pm-utils for more details.</p>]]></description>
			<author><![CDATA[dummy@example.com (el_koraco)]]></author>
			<pubDate>Tue, 05 Feb 2013 16:46:18 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287729#p287729</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287717#p287717</link>
			<description><![CDATA[<div class="quotebox"><cite>typewriterjason wrote:</cite><blockquote><div><p>Oh, that&#039;s ok. I&#039;ll do my own research.</p><p>But while I&#039;m bugging you. Do I put both the &#039;powersave&#039; script and the &#039;powersave.sh&#039; script in /usr/bin/ ?</p><p>Apologies for the pestering.</p></div></blockquote></div><p>The Makefile has the correct paths; <strong>powersave</strong> goes into /usr/bin, and <strong>powersave.sh</strong> is only if you&#039;re using systemd. If so, place it in /usr/lib/systemd/system-sleep/, if not you can ignore it. </p><p>An easy way to install would be to clone my git:</p><div class="codebox"><pre><code>git clone git://github.com/Unia/powersave.git</code></pre></div><p>Then cd in the directory you just cloned and from there, run <strong>sudo make install</strong>. It will put all the files in their respective paths as you see in the Makefile. Again, if you don&#039;t use systemd, you should remove the powersave.sh line from the Makefile before running <strong>sudo make install</strong>.</p><p>I hope that explains what you need to know?&#160; <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/big_smile.png" alt="big_smile" /></p>]]></description>
			<author><![CDATA[dummy@example.com (Unia)]]></author>
			<pubDate>Tue, 05 Feb 2013 15:36:47 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287717#p287717</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287576#p287576</link>
			<description><![CDATA[<p>Oh, that&#039;s ok. I&#039;ll do my own research.</p><p>But while I&#039;m bugging you. Do I put both the &#039;powersave&#039; script and the &#039;powersave.sh&#039; script in /usr/bin/ ?</p><p>Apologies for the pestering.</p>]]></description>
			<author><![CDATA[dummy@example.com (typewriterjason)]]></author>
			<pubDate>Mon, 04 Feb 2013 23:43:22 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287576#p287576</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287573#p287573</link>
			<description><![CDATA[<div class="quotebox"><cite>typewriterjason wrote:</cite><blockquote><div><p>Thanks for the response!</p><p>Hey, another question; your script has a powersave element for HDD, and I&#039;m using a SSD... should I comment out that line or something?</p></div></blockquote></div><p>I have no idea <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/big_smile.png" alt="big_smile" /> I have never ever read up anything on SSDs as I don&#039;t own one. You can try Googling on the subject and see if you come up with something. Otherwise, I guess I could look into it if you can&#039;t find anything. For now though, just to be safe, I&#039;d comment it out.</p>]]></description>
			<author><![CDATA[dummy@example.com (Unia)]]></author>
			<pubDate>Mon, 04 Feb 2013 23:32:53 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287573#p287573</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287561#p287561</link>
			<description><![CDATA[<p>Thanks for the response!</p><p>Hey, another question; your script has a powersave element for HDD, and I&#039;m using a SSD... should I comment out that line or something?</p>]]></description>
			<author><![CDATA[dummy@example.com (typewriterjason)]]></author>
			<pubDate>Mon, 04 Feb 2013 22:02:55 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287561#p287561</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287217#p287217</link>
			<description><![CDATA[<p>We both use a similar approach, but you might get a situation in which my script overrides Hardran&#039;s, where Hardran&#039;s would again override mine etc.. so just to be safe I would install only one at a time.</p><p>You can install them both (not simultaneously <img src="http://crunchbang.org/forums/plugins/ezbbc/style/smilies/big_smile.png" alt="big_smile" />) and then see which gives you better battery life and stick with that one.</p>]]></description>
			<author><![CDATA[dummy@example.com (Unia)]]></author>
			<pubDate>Sat, 02 Feb 2013 20:56:02 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287217#p287217</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=287177#p287177</link>
			<description><![CDATA[<p>I installed Hardran3&#039;s script the other night, and I haven&#039;t seen any major increase to the battery life.</p><p>Unia, I don&#039;t have enough knowledge to immediately tell this, so can you tell me; is your script substantially different? Can I install your script as well, or would it not play well with Hardran3&#039;s script?</p>]]></description>
			<author><![CDATA[dummy@example.com (typewriterjason)]]></author>
			<pubDate>Sat, 02 Feb 2013 17:41:27 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=287177#p287177</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=286198#p286198</link>
			<description><![CDATA[<div class="quotebox"><cite>xaos52 wrote:</cite><blockquote><div><p>Run the script yourself with -x option:</p><div class="codebox"><pre><code>sudo sh -x &lt;path-to-your-shell-script&gt;</code></pre></div></div></blockquote></div><div class="codebox"><pre><code>zubcho@crunchbang-lap:~$ sudo sh -x /etc/pm/power.d/powersave
+ buslist=pci spi i2c
+ exit 0</code></pre></div><p>and still not working</p>]]></description>
			<author><![CDATA[dummy@example.com (zubcho81)]]></author>
			<pubDate>Sun, 27 Jan 2013 19:22:05 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=286198#p286198</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=286195#p286195</link>
			<description><![CDATA[<p>Run the script yourself with -x option:</p><div class="codebox"><pre><code>sudo sh -x &lt;path-to-your-shell-script&gt;</code></pre></div>]]></description>
			<author><![CDATA[dummy@example.com (xaos52)]]></author>
			<pubDate>Sun, 27 Jan 2013 19:09:06 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=286195#p286195</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=286181#p286181</link>
			<description><![CDATA[<p>I have a question. Why when my script is triggered </p><div class="codebox"><pre class="vscroll"><code>#!/bin/sh
# A script to enable laptop power saving features for #! &amp; Debian GNU+linux.
# http://crunchbanglinux.org/forums/topic/11954

# List of modules to unload, space seperated. Edit depending on your hardware and preferences.
#modlist=&quot;uvcvideo&quot;
# Bus list for runtime pm. Probably shouldn&#039;t touch this.
buslist=&quot;pci spi i2c&quot;

case &quot;$1&quot; in
    true)
    # Enable some power saving settings while on battery
       # Enable laptop mode
        echo 5 &gt; /proc/sys/vm/laptop_mode
#--------------------------------------------------------------------------------------
       # Less VM disk activity. Suggested by powertop
        echo 1500 &gt; /proc/sys/vm/dirty_writeback_centisecs
#--------------------------------------------------------------------------------------
       # Intel power saving
        #echo Y &gt; /sys/module/snd_hda_intel/parameters/power_save_controller
        #echo 1 &gt; /sys/module/snd_hda_intel/parameters/power_save
#--------------------------------------------------------------------------------------
       # Set backlight brightness to 10%
        echo 1 &gt; /sys/class/backlight/radeon_bl/brightness
#--------------------------------------------------------------------------------------
       # USB powersaving
        for i in /sys/bus/usb/devices/*/power/autosuspend; do
            echo 1 &gt; $i
        done
#--------------------------------------------------------------------------------------
       # SATA power saving
        #for i in /sys/class/scsi_host/host*/link_power_management_policy; do
           #echo min_power &gt; $i
           #done
#--------------------------------------------------------------------------------------
       # Disable hardware modules to save power
        for mod in $modlist; do
            grep $mod /proc/modules &gt;/dev/null || continue
            modprobe -r $mod 2&gt;/dev/null
        done
#--------------------------------------------------------------------------------------        
       # Enable runtime power management. Suggested by powertop.
        #for bus in $buslist; do
            #for i in /sys/bus/$bus/devices/*/power/control; do
              #  echo auto &gt; $i
            #done

#--------------------------------------------------------------------------------------        
        #ipw2000 eth1 powersave
        iwpriv eth1 set_power 5
#--------------------------------------------------------------------------------------
		#CPU powersave mode
		cpufreq-set -g userspace 
		for i in /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor; do
			echo userspace &gt; $i 
		  done
		cpufreq-set -u1000000
			
		#Ethernet down
		ifconfig eth0 down
		
		#HDD powersave mode
		hdparm -B 1 -S 12 /dev/sda
		
		#Kill ad-on storage
		hal-disable-polling --device /dev/cdrom
		
		ethtool -s eth0 wol d
    ;;
#--------------------------------------------------------------------------------------
    false)
       #Return settings to default on AC power
        echo 0 &gt; /proc/sys/vm/laptop_mode
        echo 500 &gt; /proc/sys/vm/dirty_writeback_centisecs
        #echo N &gt; /sys/module/snd_hda_intel/parameters/power_save_controller
        #echo 0 &gt; /sys/module/snd_hda_intel/parameters/power_save
        echo 10 &gt; /sys/class/backlight/radeon_bl/brightness
        for i in /sys/bus/usb/devices/*/power/autosuspend; do
            echo 2 &gt; $i
        done
        #for i in /sys/class/scsi_host/host*/link_power_management_policy
            #do echo max_performance &gt; $i
        #done
        for mod in $modlist; do
            if ! lsmod | grep $mod; then
                modprobe $mod 2&gt;/dev/null
            fi
        done
        #for bus in $buslist; do
            #for i in /sys/bus/$bus/devices/*/power/control; do
             #done
        iwpriv eth1 set_power 6
        cpufreq-set -g ondemand
        cpufreq-set -u1710000
        ifconfig eth0 up
		hdparm -B 255 -S 60 /dev/sda
        
    ;;
esac

exit 0
  </code></pre></div><p> line 1&#160; is working </p><p>&#160; &#160; 1. cpufreq-set -g userspace <br />&#160; &#160; <br />but 2 and 3 are not...<br />&#160; &#160; <br />&#160; &#160; 2.&#160; &#160; for i in /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor; do<br />&#160; &#160; &#160; &#160; &#160; &#160; echo userspace &gt; $i <br />&#160; &#160; &#160; &#160; &#160; done<br />&#160; &#160; 3.&#160; &#160; cpufreq-set -u1000000</p><p>and the processor stays at 600mhz</p><div class="codebox"><pre><code> cpufreq-info 

cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
  driver: acpi-cpufreq
  CPUs which run at the same hardware frequency: 0
  CPUs which need to have their frequency coordinated by software: 0
  maximum transition latency: 10.0 us.
  hardware limits: 600 MHz - 1.70 GHz
  available frequency steps: 1.70 GHz, 1.60 GHz, 1.40 GHz, 1.20 GHz, 1000 MHz, 800 MHz, 600 MHz
  available cpufreq governors: userspace, powersave, ondemand, conservative, performance
  current policy: frequency should be within 600 MHz and 600 MHz.
                  The governor &quot;userspace&quot; may decide which speed to use
                  within this range.
  current CPU frequency is 600 MHz.</code></pre></div><p>I want it to run between 600 and 1000 mhz, but it is working at 600.</p><p>I have to manually set in terminal <br />sudo cpufreq-set -u1000000</p><p>And it is working.</p>]]></description>
			<author><![CDATA[dummy@example.com (zubcho81)]]></author>
			<pubDate>Sun, 27 Jan 2013 18:30:03 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=286181#p286181</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=284318#p284318</link>
			<description><![CDATA[<div class="quotebox"><cite>foozer wrote:</cite><blockquote><div><p>Are you sure those are not the same lines from before? Remove the log file, it will create a new one. Test unplugging and plugging and see if they pop up again.</p></div></blockquote></div><p>Ok that did the trick. Now I&#039;m getting this:</p><div class="codebox"><pre class="vscroll"><code>/usr/lib/pm-utils/power.d/anacron true:success.
/etc/pm/power.d/powersave true:/etc/pm/power.d/powersave: 66: cannot create /sys/devices/virtual/backlight/acpi_video0/brightness: Directory nonexistent
/etc/pm/power.d/powersave: 66: cannot create /sys/bus/spi/devices/*/power/control: Directory nonexistent
success.
/usr/lib/pm-utils/power.d/sched-powersave true:**sched policy powersave ON
success.
/usr/lib/pm-utils/power.d/anacron false:success.
/etc/pm/power.d/powersave false:/etc/pm/power.d/powersave: 66: cannot create /sys/devices/virtual/backlight/acpi_video0/brightness: Directory nonexistent
/etc/pm/power.d/powersave: 66: cannot create /sys/bus/spi/devices/*/power/control: Directory nonexistent
success.
/usr/lib/pm-utils/power.d/sched-powersave false:**sched policy powersave OFF
success.
/usr/lib/pm-utils/power.d/anacron true:success.
/etc/pm/power.d/powersave true:/etc/pm/power.d/powersave: 66: cannot create /sys/devices/virtual/backlight/acpi_video0/brightness: Directory nonexistent
/etc/pm/power.d/powersave: 66: cannot create /sys/bus/spi/devices/*/power/control: Directory nonexistent
success.
/usr/lib/pm-utils/power.d/sched-powersave true:**sched policy powersave ON
success.
/usr/lib/pm-utils/power.d/anacron false:success.
/etc/pm/power.d/powersave false:/etc/pm/power.d/powersave: 66: cannot create /sys/devices/virtual/backlight/acpi_video0/brightness: Directory nonexistent
/etc/pm/power.d/powersave: 66: cannot create /sys/bus/spi/devices/*/power/control: Directory nonexistent
success.
/usr/lib/pm-utils/power.d/sched-powersave false:**sched policy powersave OFF
success.
/usr/lib/pm-utils/power.d/anacron true:success.
/etc/pm/power.d/powersave true:/etc/pm/power.d/powersave: 66: cannot create /sys/devices/virtual/backlight/acpi_video0/brightness: Directory nonexistent
/etc/pm/power.d/powersave: 66: cannot create /sys/bus/spi/devices/*/power/control: Directory nonexistent
success.
/usr/lib/pm-utils/power.d/sched-powersave true:**sched policy powersave ON
success.</code></pre></div><p>So everything works now, except I don&#039;t have those /sys entries on my system. Next challenge is gonna be to sort those out. Thanks for your help!</p>]]></description>
			<author><![CDATA[dummy@example.com (bandibp)]]></author>
			<pubDate>Fri, 18 Jan 2013 21:50:52 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=284318#p284318</guid>
		</item>
		<item>
			<title><![CDATA[Re: Laptop power saving script for #! & Debian]]></title>
			<link>http://crunchbang.org/forums/viewtopic.php?pid=284314#p284314</link>
			<description><![CDATA[<div class="quotebox"><cite>bandibp wrote:</cite><blockquote><div><div class="quotebox"><cite>foozer wrote:</cite><blockquote><div><p>The powersave options are supposed to be ON when /etc/pm/power.d/powersave gets the &quot;true&quot; parameter, and OFF when it gets the &quot;false&quot; parameter, so everything is alright. When unplugging your AC cable, &quot;powersave true&quot; is called, when plugging it in, &quot;powersave false&quot; is called.</p></div></blockquote></div><p>Thank you, now the script is executable, but I&#039;m still getting &#039;not executable&#039; on a couple of lines when running <em>cat /var/log/pm-powersave.log</em>. Should I be concerned about this?</p></div></blockquote></div><p>Are you sure those are not the same lines from before? Remove the log file, it will create a new one. Test unplugging and plugging and see if they pop up again.</p>]]></description>
			<author><![CDATA[dummy@example.com (foozer)]]></author>
			<pubDate>Fri, 18 Jan 2013 21:39:01 +0000</pubDate>
			<guid>http://crunchbang.org/forums/viewtopic.php?pid=284314#p284314</guid>
		</item>
	</channel>
</rss>
