View previous topic :: View next topic |
Author |
Message |
info4all n00b
Joined: 23 Jan 2005 Posts: 45
|
Posted: Fri May 27, 2005 8:02 pm Post subject: radeontool script idea? [SOLVED (WORK AROUND)] |
|
|
I don't know how many people are running ati radeon video cards in there laptops but I am running one and I am tired of having to fuss with radeontool light off/on. I have an idea for a script but there are just two problems 1) I don't know the first thing about writing scripts (I am currently trying to teach myself from http://www.freeos.com/guides/lsst/ ) 2) I don't know much about the linux OS. So I wanted to throw out an idea to all you and see if 1) it is possable to do 2) if someone would mind writing it or giving me enough information so I could write it myself. So without further ado... the idea:
Power saving shuts down the monitor and other things. I assume this occurance is monitored somewhere in the OS. Is it possible to have a script watch for a blank screen and then run radeontool light off and then watch for a wakeup command and run radeontool light on? If that is not a possibility what about a program that will turn the screen off after x time of not being used and have it come back on once it is in use again.
Thanks for reading!
Last edited by info4all on Mon Jun 06, 2005 3:42 pm; edited 1 time in total |
|
Back to top |
|
|
Specialized Apprentice
Joined: 11 Jan 2005 Posts: 264
|
Posted: Sun Jun 05, 2005 2:44 pm Post subject: |
|
|
Code: | !/bin/sh
if radeontool light | grep -q "looks on" ; then
radeontool light off
elif radeontool light | grep -q "looks off" ; then
radeontool light on
fi |
Save it as radeontool.sh and make it executable by doing this:
Code: | chmod 0777 [path to the script]/radeontool.sh |
This script should do it, but you need type whitout screen to enable your backlight. Better it is to put this script on a hotkey.
For my ibm-laptop I got an acpi-event to do this. |
|
Back to top |
|
|
info4all n00b
Joined: 23 Jan 2005 Posts: 45
|
Posted: Sun Jun 05, 2005 4:27 pm Post subject: |
|
|
Thanks Specialized! I do want to clear something up before I try this. I am a little confused about the typing without a screen. Is the script just one quick check or a constant monitor? Does the script only turn the screen off or does it turn on the screen as well but only when executed while the screen is off?
Thank you |
|
Back to top |
|
|
Specialized Apprentice
Joined: 11 Jan 2005 Posts: 264
|
Posted: Sun Jun 05, 2005 5:03 pm Post subject: |
|
|
It turns off the monitor and it will stay dark until you execute the script once again.
You just have to use the up arrow and then press enter.
But you have to be carefull, the konsole needs to be in foreground, if it turns to the background it's hard to get it back to foreground and execute the script.
Thats why it is better to have in on a hotkey, then you just press this key and the backlight will get on. |
|
Back to top |
|
|
tsunam Retired Dev
Joined: 23 Feb 2004 Posts: 343
|
Posted: Sun Jun 05, 2005 5:23 pm Post subject: |
|
|
if you want a automatic powering off when you close your lid etc.
Code: | case "$group" in
button)
case "$action" in
lid)
Lidstate="$(cat /proc/acpi/button/lid/LID/state | awk '{print $2}')"
case "$Lidstate" in
open)
radeontool light on
;;
closed)
radeontool light off
;;
esac
esac
|
if you put that in your /etc/acpi/default.sh. Of course you need the acpi events for button so that you can have a active trigger. _________________ I'm not afraid of happy endings, just afraid my life wont work that way. |
|
Back to top |
|
|
Specialized Apprentice
Joined: 11 Jan 2005 Posts: 264
|
Posted: Sun Jun 05, 2005 6:29 pm Post subject: |
|
|
Yes, I would say that's a good solution. |
|
Back to top |
|
|
info4all n00b
Joined: 23 Jan 2005 Posts: 45
|
Posted: Mon Jun 06, 2005 3:41 pm Post subject: |
|
|
Thanks Specialized for clearing that up for me and thanks tsunam for that extra bit of code. I have the hotkey and it works just fine. I would like to bind this action with the x event blank screen but this will work until I can find that.
Thank you |
|
Back to top |
|
|
|