|
|
Zaurus 中文论坛 - 手持linux设备专用 |
 |
View previous topic :: View next topic |
Author |
Message |
6502
Joined: 20 Nov 2007 Posts: 6
小企鹅: 242
|
Posted: 2007-Dec-21 Fri, pm9:14 |
|
Post subject: zpm-命令行CPU频率&屏幕亮度调节程序, 7500C通过 |
|
觉得进X调屏幕亮度和CPU频率比较麻烦。于是写了个小程序zpm, 能在命令行下面直接设置屏幕亮度和CPU频率,也不需要进X, 省电比较方便,希望能对大家有用。
我的机器是SL-7500C,其他机器没有试过,暂不支持。
Code: | #zpm
zpm-0.1.11 - Power Management for Zaurus/SL-7500C
6502(walkdan(at)gmail.com)
Usage: zpm [OPTIONS]
-h, --help Display this help and exit.
p, -p, --powersaver Scheme: Super Power Saver, -s=1 -c=121
n, -n, --normal Scheme: Normal, -s=4 -c=161
P, -P, --highperf Scheme: High Performence, -s=6 -c=162
-b, --black Set screen black, -s=0
-s, --screenlight=LIGHT Set screen light, value is 0~6
-c, --cpuclock=CPUCLOCK Set cpu clock, CPUCLOCK=121,141,161,162
o, -o, --option Show options, let user to choose
-V, --version Show version number
+, Increase light
-, Decrease light
|
zpm p 设定最省电模式(屏幕最暗,CPU最慢)
zpm n 设定正常模式
zpm P 设定超频模式
zpm o 自定义模式
我用的是命令行的MP3播放器MPD, 用zpm p模式大概播放6个小时以上。
修改了一下,打包成ipk,方便大家使用
安装: ipkg install zpm_0.1.11_armv5tel.ipk
删除: ipkg remove zpm
Description: |
Power Management for Zaurus/SL-7500C |
|
 Download |
Filename: |
zpm_0.1.11_armv5tel.ipk |
Filesize: |
1.86 KB |
Downloaded: |
99 Time(s) |
_________________ SL-7500C+1G SD+1G CF, pdaXrom 1.1.0beta3
求C1000或C3X00
Last edited by 6502 on 2007-Dec-27 Thu, pm12:17; edited 12 times in total |
|
Back to top |
|
hotgly
Joined: 22 Apr 2007 Posts: 130
小企鹅: 4504
|
Posted: 2007-Dec-21 Fri, pm10:00 |
|
Post subject: |
|
高人啊。
请问那几种模式的设定是怎样的?
还有,7500c能超到472以上吗?
_________________ sl-7500c pdaxrom1.1.0beta1wellswang汉化
extremeIII CF,SD Roku Agere Hermes II CF Wifi with ccpaging driver for 7500c
Ubuntu Hardy box |
|
Back to top |
|
plum
Joined: 03 Jan 2007 Posts: 129 Location: 河南 郑州 小企鹅: 3482
|
Posted: 2007-Dec-21 Fri, pm10:28 |
|
Post subject: |
|
恭喜,我是修改了一下startx脚本,就可以用fn键+1,2,3,4控制屏幕了
_________________ http://www.imobile365.com
Zaurus C1k+4G CF+Cell CF wifi+2G SD
ubuntu 7.10
WIndows XP Which in the VBOX under the ubuntu |
|
Back to top |
|
6502
Joined: 20 Nov 2007 Posts: 6
小企鹅: 242
|
Posted: 2007-Dec-21 Fri, pm10:59 |
|
Post subject: |
|
472以上死机。
_________________ SL-7500C+1G SD+1G CF, pdaXrom 1.1.0beta3
求C1000或C3X00 |
|
Back to top |
|
ccpaging
Joined: 07 Dec 2006 Posts: 757
小企鹅: 16604
|
|
Back to top |
|
6502
Joined: 20 Nov 2007 Posts: 6
小企鹅: 242
|
Posted: 2007-Dec-23 Sun, pm12:31 |
|
Post subject: |
|
呵呵,是个Bourne shell脚本,很简单。
Code: | #!/bin/sh
#
# zpm - Power Management for Zaurus SL-7500C
# This program can adjust screen light & cpu clock
# 6502 ( walkdan(at)gmail.com ) 2007/12/20
# core data:
# screenlight=
# cpuclock=
VER=0.1.10
usage()
{
cat <<EOF
zpm-$VER - Power Management for Zaurus/SL-7500C
(C)6502<walkdan(at)gmail.com>
Usage: `basename $0` [OPTIONS]
-h, --help Display this help and exit.
p, -p, --powersaver Scheme: Super Power Saver, -s=1 -c=121
n, -n, --normal Scheme: Normal, -s=4 -c=161
P, -P, --highperf Scheme: High Performence, -s=6 -c=162
-b, --black Set screen black, -s=0
-s, --screenlight=LIGHT Set screen light, value is 0~6
-c, --cpuclock=CPUCLOCK Set cpu clock, CPUCLOCK=121,141,161,162
o, -o, --option Show options, let user to choose
-V, --version Show version number
+, Increase light
-, Decrease light
EOF
}
log_err()
{
echo "$@" >&2
}
do_option()
{
echo
echo "choose light:"
select screenlight in 1 2 3 4 5 6; do
break
done
echo
echo "choose clock:"
select clock in "121 - lowest" "141 - low" "161 - normal" "162 - high"; do
cpuclock=${clock% -*}
break
done
}
parse_arguments()
{
for arg do
[ -z $debug] || log_err "$arg"
case "$arg" in
-h|--help) usage; exit 0;;
p|-p|--powersaver)parse_arguments -s=1 -c=121;;
n|-n|--normal) parse_arguments -s=4 -c=161;;
P|-P|--highperf)parse_arguments -s=6 -c=162;;
-b|--black) parse_arguments -s=0;;
--screenlight=*)screenlight=`echo "$arg" | sed -e "s;--screenlight=;;"`;;
-s=*) screenlight=`echo "$arg" | sed -e "s;-s=;;"`;;
--cpuclock=*) cpuclock=`echo "$arg" | sed -e "s;--cpuclock=;;"`;;
-c=*) cpuclock=`echo "$arg" | sed -e "s;-c=;;"`;;
o|-o|--option) do_option;;
+) setfl +;;
-) setfl -;;
-D|--debug) debug="on";;
-V|--version) echo "zpm version:$VERSION";;
*) log_err "bad argument:$arg"; exit 1;;
esac
done
#exit 0;
}
if [ $# -eq 0 ]; then
usage
exit 1
fi
parse_arguments "$@"
[ -z $debug ] || log_err "[screenlight=$screenlight,cpuclock=$cpuclock]"
#set screenlight
if [ ! -z $screenlight ]; then
# check screenlight
if [ $screenlight -lt 0 -o $screenlight -gt 6 ]; then
log_err "bad screenlight argument:$screenlight"
exit 1
fi
setfl $screenlight
echo "Screen light: $screenlight"
fi
#set cpuclock
if [ ! -z $cpuclock ]; then
# check cpuclock
if [ $cpuclock -lt 121 -o $cpuclock -gt 162 ]; then
log_err "bad cpuclock argument:$cpuclock"
exit 1
fi
echo $cpuclock > /proc/cccr_change
echo "Clock: `cat /proc/cccr_change`"
fi |
_________________ SL-7500C+1G SD+1G CF, pdaXrom 1.1.0beta3
求C1000或C3X00
Last edited by 6502 on 2007-Dec-23 Sun, pm4:52; edited 1 time in total |
|
Back to top |
|
ninnd
Joined: 16 Nov 2007 Posts: 167
小企鹅: 5096
|
Posted: 2007-Dec-23 Sun, pm4:19 |
|
Post subject: |
|
奇强
_________________ 7500C,1G SD ,1G CF,pdaXrom 1.1 Beta1
QQ349963519 |
|
Back to top |
|
mmxb
Joined: 16 May 2007 Posts: 74
小企鹅: 1947
|
Posted: 2007-Dec-25 Tue, pm4:10 |
|
Post subject: 谢谢楼住 |
|
谢谢楼住
|
|
Back to top |
|
ccpaging
Joined: 07 Dec 2006 Posts: 757
小企鹅: 16604
|
|
Back to top |
|
|
|
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 You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
|
 |
[ 页面生成时间: 秒 ] :: [ 次查询 ] :: [ ]
|
 |
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional
|
 |
|
|
|
|