Registered Member
|
I am looking for a way to temporary inhibit power management from the command line in 4.8.3. Google tells me that solutions like the following should work:
When I run this command, it returns an incrementing value, leading me to believe it is keeping tack of the inhibit request... however the power management feature is not inhibited - it continues to operate normally. The other potential solution is to toggle between power profiles as needed, however that also does not seem to work.
Which returns nothing, even when a undefined power management profile string is used |
Administrator
|
For the loadProfile D-Bus command, it takes a boolean value. I am not aware unfortunately of what it does, however it is not likely to change the profile which is loaded.
For the Inhibit issue, I will need to check with the Powerdevil sources as to the precise behaviour involved. I suspect it may be listening for D-Bus disconnections and terminating the inhibitions of applications which quit.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Funny you should mention that... I found a script yesterday at http://lists.exherbo.org/pipermail/paludis-user/2011-April/001705.html which uses python to make the inhibit call, and then sleeps until terminated... A simplified version of this is:
As fast as I can tell, this code works as well, as HasInhibit is set to true as long as the python script is running. Unfortunately, the inhibit is still not honored by the power management feature in 4.8.3. I'll go try to find the code for powerdevil next. When running:
When terminated:
|
Administrator
|
I have checked the PowerDevil code. As it turns out - it takes a limited definition of inhibition - only actions which interrupt are prohibited.
Any action involving the screen needs to be inhibited via a different method. Please see qdbus org.kde.kded /org/kde/Solid/PowerManagement/PolicyAgent To fully inhibit everything, you need to make three calls to addInhibit, passing a different value as the integer each time. Their values need to be: 1 (InterruptSession), 2 (ChangeProfile) and 4 (ChangeScreenSettings). 3 does not exist. The two QString values are appname and reason as you have done above. Something like the following should work in Python I imagine:
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
While I am unclear on the reasoning behind the underlying approach shown above, this solution worked! I am grateful for your assistance. I did get a chance to look though the powerdevil code briefly and it was clear that it would take some time to figure out as I am new to KDE and QT. I will pass this info on to the mythtv community as well in case it helps someone else out. For those reading this thread, note that you have to run the above scripts in a terminal with access to the display you wish to control. I found that I needed to (a) as the user running the KDE session, execute a "xhost +" call to allow access to the session (you can limit access to localhost only if you like). (b) needed to run script with DISPLAY prefix (c) the script needs to run until the inhibit is no longer required For mythtv, I will probably use the system event triggers to leave a flag which another script will looked for, and in turn inhibit the power management.
Invoke with
|
Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]