Xfce Forum

Sub domains
 

You are not logged in.

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

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

[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
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

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

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

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
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,494

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.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.010 seconds, 7 queries executed - Memory usage: 528.84 KiB (Peak: 530.13 KiB) ]