Dne, 24. 10. 2009 21:15:34 je Brian C. Wells napisal(a):
> 
> Wow.  Except for the part about writing a script, I have no idea 
> about
> how to do that.  Can you attach a copy of your script to the email
> (and
> does Debian's list server forward attachments?) or can you upload the
> script to a pastebin website or something?  That would at least give
> me
> an idea of what commands I would need to use.

Well, the script is quite simple, it only works in Gnome (a 
more system-wide script would have to be run as superuser and I just 
couldn't be bothered to type in my root password every time I wanted to 
change CPU governor):

<script to copy/paste:>

#!/bin/bash

state=`gconftool --get /apps/gnome-power-manager/cpufreq/policy_ac | 
cut -d\  -f1`

if [ $state == "ondemand" ]; then
  countdown=`echo {99..1}`
  gconftool --type string --set /apps/gnome-power-manager/cpufreq/
policy_ac "powersave"
  gconftool --type int --set /apps/gnome-power-manager/backlight/
brightness_ac "50"
else
  countdown=`echo {1..99}`
  gconftool --type string --set /apps/gnome-power-manager/cpufreq/
policy_ac "ondemand"
  gconftool --type int --set /apps/gnome-power-manager/backlight/
brightness_ac "95"
fi

state=`gconftool --get /apps/gnome-power-manager/cpufreq/policy_ac | 
cut -d\  -f1`

for i in $countdown; do echo $i; sleep 0.01; echo "#";done|zenity --
progress --auto-close --title=$state
echo CPU governor switched to $state.

</end of script to copy/paste>

The script is self-explanatory. You save it under a name of your choice 
(say, CPU_governor_toggle), set its executable bit, ... you know the 
drill.


-- 
Regards,

Klistvud
Certifiable Loonix User #481801


--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to