How to get rid of sleep/hibernate?

Manuel Reimer Manuel.Spam at nurfuerspam.de
Tue Dec 21 20:22:18 GMT 2010


Manuel Reimer wrote:
> anything, I want, is to get rid of the buttons "Sleep" and "Hibernate" below
> K-Menu ->  Leave. How to do that?
>
> It's nice, that KDE tries to autodetect that, but at least for "Hibernate" some
> more configuration is required and I don't want/need that.

As I got no answer, I have digged into the source code.

At first: It's not KDE who tries to autodetect, but HAL. HAL uses "pm-utils" to 
do all this "standby"-stuff, but it *doesn't* help to just uninstall pm-utils...

This is the code, used by HAL, to communicate with pm-utils:
http://cgit.freedesktop.org/hal/plain/tools/hal-system-power-pm-is-supported.c

And if we have a look at the "g_spawn_command_line_sync"-lines and the 
GNOME-documentation for this:
<http://library.gnome.org/devel/glib/unstable/glib-Spawning-Processes.html#g-spawn-command-line-sync>
then we see, that they don't check the return value and just set "error" (last 
parameter) to "NULL". This means, that a non-existent pm-utils makes this code 
report that all ways of standby are supported...

The only way to really get rid of this stuff is to make sure 
/usr/bin/pm-is-supported exists and always returns an exit code of one. So the 
steps to get rid of sleep/hibernate are:

1. Uninstall pm-utils. You won't need them if you don't plan to use
    sleep/hibernate. This makes sure that a possible update of this package
    doesn't overwrite our "pm-is-supported"-replacement.
2. Run the following command to symlink between /bin/false and pm-is-supported:
    # ln -s /bin/false /usr/bin/pm-is-supported

Yours

Manuel

___________________________________________________
This message is from the kde mailing list.
Account management:  https://mail.kde.org/mailman/listinfo/kde.
Archives: http://lists.kde.org/.
More info: http://www.kde.org/faq.html.




More information about the kde mailing list