Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-08-07 09:44:50

tuxolero
Member
Registered: 2013-02-10
Posts: 59

[Solved] Can I make xfce suspend use pm-suspend or run /etc/pm/sleep.d/* ?

The reason why I'm asking this is that I really, really need to run the scripts in /etc/pm/sleep.d/ and at the moment, this only happens when I run pm-suspend (as root) from the commandline but not when I click XFCE-Menu -> Log Out -> Suspend.

Of course, I could put these scripts to another place if needed by xfce suspend.

I'm running XFCE 4.12 on Arch Linux.

Edit:
sudo pm-suspend (as normal user) works too, as I have allowed pm-suspend with the NOPASSWD option in /etc/sudoers

Thanks,
Tuxolero

Last edited by tuxolero (2015-08-07 09:49:42)

Offline

#2 2015-08-07 10:28:59

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,688

Re: [Solved] Can I make xfce suspend use pm-suspend or run /etc/pm/sleep.d/* ?

tuxolero wrote:

The reason why I'm asking this is that I really, really need to run the scripts in /etc/pm/sleep.d/ and at the moment,

Systemd also supports sleep hooks. You need to re-write them in the format of:

#!/bin/sh
case $1/$2 in
  pre/*)
    echo "Going to $2..."
    #your pre-sleep commands
    ;;
  post/*)
    echo "Waking up from $2..."
    #your post-sleep commands
    ;;
esac

...make them executable and place them in /usr/lib/systemd/system-sleep. Just keep in mind that they are run concurrently.

Online

#3 2015-08-07 11:57:50

tuxolero
Member
Registered: 2013-02-10
Posts: 59

Re: [Solved] Can I make xfce suspend use pm-suspend or run /etc/pm/sleep.d/* ?

I even did not know that it's using systemd states in the end :-)
The concurrent execution is no problem in my case. In fact, I have only two scripts, one will do nothing in 'pre' and the other one will do nothing in 'post', so they won't ever interfere.

After rewriting my scripts, can I uninstall the pm-utils (from the XFCE point of view) ?

Last edited by tuxolero (2015-08-07 12:07:17)

Offline

#4 2015-08-07 13:03:29

ToZ
Moderator
From: Canada
Registered: 2011-06-02
Posts: 6,688

Re: [Solved] Can I make xfce suspend use pm-suspend or run /etc/pm/sleep.d/* ?

tuxolero wrote:

After rewriting my scripts, can I uninstall the pm-utils (from the XFCE point of view) ?

Yes. Xfce will work fine with systemd.

Online

Board footer

Powered by FluxBB