3

I would like my power button to suspend - no questions asked.

xfce4-power-manager would like my power button to suspend - but only after I have been asked:

An application is currently disabling the automatic sleep. Doing this action now may damage the working state of this application.

It seems to be caused by having a YouTube video on pause. And I really could not care less. The surprising part is that if I close my lid, then xfce4-power-manager does understand that it should suspend no questions asked.

So is there a way I can make xfce4-power-manager understand that when I press the power button, I simply want the same behaviour as if I closed the lid?

In Power manager settings both 'When power button is pressed' and 'When laptop lid is closed' are set to 'Suspend'.

0

try this:

git clone git://git.xfce.org/xfce/xfce4-power-manager

edit xfce4-power-manager/src/xfpm-power.c

find and comment lines:

if(power->priv->inhibited && force == FALSE) {
    GtkWidget *dialog;
    gboolean ret;

    dialog = gtk_message_dialog_new(NULL,
            GTK_DIALOG_MODAL,
            GTK_MESSAGE_QUESTION,
            GTK_BUTTONS_YES_NO,
            _("An application is currently disabling the automatic sleep. "
                "Doing this action now may damage the working state of this application.\n"
                "Are you sure you want to hibernate the system?"));
    ret = gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);


    if(!ret || ret == GTK_RESPONSE_NO)
        return;
}

run:

cd xfce4-power-manager
sh autogen.sh
make

copy:

cp -pf src/xfce4-pm-helper /usr/bin
cp -pf src/xfce4-power-manager /usr/bin
cp -pf src/xfpm-power-backlight-helper /usr/bin

to /usr/bin or where xfce4-power-manager is

logout and login.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.