Registered Member
|
Hi,
First, sorry for my poor English... In power settings, I can enable automatic suspend after 10mn (or other time). I'd like to be able to disable (and enable again) this automatic suspend by command line. Someone knows how to do that please ? NB : I don't want to suspend by command line, I already know how to do that... I just want to disable the setting of automatic suspend. Thanks. |
Administrator
|
This could be rather difficult. Do you still need all other forms of power management enabled?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Yes.
I don't need them on my desktop, but I need them on laptops. |
Administrator
|
Okay, in this case there are no explicit command lines you can run. However, there are two files which can be altered, and a command which can be run - which will have the result of allowing you to enable/disable automatic suspend.
The file most likely to need modification is powermanagementprofilesrc. After modifying the file(s) in question you need to run this command to cause KDE to reload it's power management rules:
The other alternative you could do is write a small script which creates a power management inhibition, and then exits when you instruct it to. KDE's Power Management system follows the FDO specification here, so i'd suggest referring to their documentation on this.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Perfect.
I'll try that. Thank you very much. |
Registered Member
|
In fact, it doesn't work.
I modify .kde4/share/config/powermanagementprofilesrc, it's exactly as it is when I modify it by settings menu. I launch /usr/bin/qdbus org.kde.kded /org/kde/Solid/PowerManagement reparseConfiguration, but after 15mn, suspend is done. Are you sure that's the good command to "reload" settings ? I use kde 4.11.2. Hee is my script :
|
Administrator
|
Yes, that should be the correct command - it is the exact same one used by the configuration panel.
Your script is running under your normal user account correct?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Yes. |
|
inhibit_cookie=`qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit Inhibit "Me" "I am your god"`
qdbus org.freedesktop.PowerManagement.Inhibit /org/freedesktop/PowerManagement/Inhibit Uninhibit $inhibit_cookie you likely want to store the cookie in some file to read it later on (and use as lockfile) |
Registered Member
|
...hmmm... can you explain what it does please ? Those 2 lines disable automatic suspend only (not screen savepower) ? If yes, how to enable it again after ? If no, that's not what I asked |
|
1st off, there's a typo: "UnInhibit", not "Uninhibit"
The first line is supposed to prevent stuff like suspending and screen locking, but not screen dimming (dunno at hand about "dpms off") The second line will UnInhibt power saving. There's however claim this would not work for stuff like qdbus/dbus-send but only for eg. python-dbus and likely cpp interfaces - i assume the power manager checks the caller PID. I can also confirm that reparsing the config does not appear to happen. Only resort to suggest is to unload powerdevil: qdbus org.kde.kded /kded unloadModule powerdevil xset dpms 360 480 480 xset +dpms # do dpms the xorg way And reload it afterwards: qdbus org.kde.kded /kded loadModule powerdevil Notice that any other user or service can still kick in and STR, it's basically just writing a string into /sys/power/state |
Registered Member
|
I need to use google translate to understand all, but by advance, thanks for your help
|
Registered Member
|
You point something I don't understand. I have and need powerdevil to be able to configure suspend. If I don't emerge powerdevil, I don't have power settings (energy management) in the menu. But I realize, it disables dpms. But, if I unload powerdevil module, the settings choices are différents... therefore I can enable suspend. So, why do I need powerdevil package ? Or, why do I need powerdevil module loaded ? If the module is unloaded, even if I can set suspend time, it will never suspend ? If I could have dpms enabled (as several months ago), I wouldn't have to set it in the power setting AND I would have screen blanking even on kde session choice, not only when a user session is opened, so i'd prefer to have dpms working. May be it's because my english is very bad, but all of this seems to be very difficult to understand for me. And I need to understand that before finding the best solution to disable/enable automatic suspend. |
Registered Member
|
I can confirm that with powerdevil unloaded, no suspend.
So the solution unloading it to disable automatic suspend, then reloading it to enable can be what I need. But, a question, in my script, what command can I use to test is powerdevil is loaded or not please ? |
Registered Member
|
qdbus org.kde.kded /kded loadedModules | grep -q powerdevil ? |
Registered users: Bing [Bot], gfielding, Google [Bot], Sogou [Bot]