Zorael
June 9th, 2008, 11:48 AM
(Thread aim changed along the way, it'll be confusing until you reach the next post.)
I have a laptop. Earlier today, I had it on battery power and thought I'd compress a folder while I search for the AC adaptor. While doing this, I see my beatiful screensaver pop up, draining my precious battery strength with gorgeous graphics (Fractals -> Julia)! What gall!
So I thought I'd write a script and then find some way to have it run when it switches between power modes.
$ dcop kdesktop KScreensaverIface functions
QCStringList interfaces()
QCStringList functions()
void lock()
void save()
void quit()
bool isEnabled()
bool enable(bool e)
bool isBlanked()
void configure()
void setBlankOnly(bool blankOnly)
void saverLockReady()
The optimal solution would be to have it set it to suspend *the screen* for screensaving, when on battery, but kdesktop doesn't seem to handle that. If this is handled by another program (xset?), perhaps it'd be possible to use dcop to disable kdesktop's 'saver and then set that program to suspend the screen (early) in its place. But I can't figure out what that program might be.
A suboptimal but acceptable solution is to have it use the blank screen 'saver when on battery, which seems to be possible to toggle temporarily with this DCOP call:
$ dcop kdesktop setBlankOnly true
Likewise, setting it to false seems to restore it to once again use the defined screensaver. However, I still can't seem to change the timer value, which I'd really like to do. What the configure function does is beyond me; it doesn't accept arguments (void), and invoking it does nothing.
I'd also need to know where to hook this script to get it to run upon power mode switch.
Any ideas? I'm running on fumes now.
I have a laptop. Earlier today, I had it on battery power and thought I'd compress a folder while I search for the AC adaptor. While doing this, I see my beatiful screensaver pop up, draining my precious battery strength with gorgeous graphics (Fractals -> Julia)! What gall!
So I thought I'd write a script and then find some way to have it run when it switches between power modes.
$ dcop kdesktop KScreensaverIface functions
QCStringList interfaces()
QCStringList functions()
void lock()
void save()
void quit()
bool isEnabled()
bool enable(bool e)
bool isBlanked()
void configure()
void setBlankOnly(bool blankOnly)
void saverLockReady()
The optimal solution would be to have it set it to suspend *the screen* for screensaving, when on battery, but kdesktop doesn't seem to handle that. If this is handled by another program (xset?), perhaps it'd be possible to use dcop to disable kdesktop's 'saver and then set that program to suspend the screen (early) in its place. But I can't figure out what that program might be.
A suboptimal but acceptable solution is to have it use the blank screen 'saver when on battery, which seems to be possible to toggle temporarily with this DCOP call:
$ dcop kdesktop setBlankOnly true
Likewise, setting it to false seems to restore it to once again use the defined screensaver. However, I still can't seem to change the timer value, which I'd really like to do. What the configure function does is beyond me; it doesn't accept arguments (void), and invoking it does nothing.
I'd also need to know where to hook this script to get it to run upon power mode switch.
Any ideas? I'm running on fumes now.