[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: suspend2 support

Marcin Juszkiewicz wrote:
> Does someone know how to integrate suspend2 support in KDE 3.5 on desktop
> machine? I recently upgraded to 2.6.15(-rc) with that patch and found it
> nice but hibernating via "sudo hibernate" is not an option here as not
> all users use Konsole.
> Best way would be 'Hibernate' option in logout window..

I thought about this a lot (albeit I have switched now to in-kernel suspend
after long time using suspend2, but that's besides the point, I still use
hibernate), but IMHO hacking logout window requires C++ patching, and I am
not able (and willing) to go there. What I did is just to create new item
in K-menu (with keyboard shortcut) which runs this script:

if [ -z $DISPLAY ] ; then exit ; fi

kdialog --yesnocancel "Suspend to RAM?"
if [[ $RESULT -eq "0" ]]; then
   sudo -u root /usr/sbin/hibernate -F /etc/hibernate/ram.conf

if [[ $RESULT -ne "2" ]]; then
   sudo -u root /usr/sbin/hibernate

Certainly that your script will be different (e.g., something about the
lines of too-well known "Are you sure?" dialog box), but I think it is the
easiest way to go.


Matej Cepl, http://www.ceplovi.cz/matej/blog/
GPG Finger: 89EF 4BC6 288A BF43 1BAB  25C3 E09F EF25 D964 84AC
In those days spirits were brave, the stakes were high, men were
real men, women were real women and small furry creatures from
Alpha Centauri were real small furry creatures from Alpha
    -- Douglas Adams

Reply to: