Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
radeontool script idea? [SOLVED (WORK AROUND)]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
info4all
n00b
n00b


Joined: 23 Jan 2005
Posts: 45

PostPosted: Fri May 27, 2005 8:02 pm    Post subject: radeontool script idea? [SOLVED (WORK AROUND)] Reply with quote

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
View user's profile Send private message
Specialized
Apprentice
Apprentice


Joined: 11 Jan 2005
Posts: 264

PostPosted: Sun Jun 05, 2005 2:44 pm    Post subject: Reply with quote

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
View user's profile Send private message
info4all
n00b
n00b


Joined: 23 Jan 2005
Posts: 45

PostPosted: Sun Jun 05, 2005 4:27 pm    Post subject: Reply with quote

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
View user's profile Send private message
Specialized
Apprentice
Apprentice


Joined: 11 Jan 2005
Posts: 264

PostPosted: Sun Jun 05, 2005 5:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
tsunam
Retired Dev
Retired Dev


Joined: 23 Feb 2004
Posts: 343

PostPosted: Sun Jun 05, 2005 5:23 pm    Post subject: Reply with quote

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
View user's profile Send private message
Specialized
Apprentice
Apprentice


Joined: 11 Jan 2005
Posts: 264

PostPosted: Sun Jun 05, 2005 6:29 pm    Post subject: Reply with quote

Yes, I would say that's a good solution.
Back to top
View user's profile Send private message
info4all
n00b
n00b


Joined: 23 Jan 2005
Posts: 45

PostPosted: Mon Jun 06, 2005 3:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
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