Xfce Forum

Sub domains
 

You are not logged in.

#1 2022-12-20 00:03:18

Ha!
Member
Registered: 2022-12-19
Posts: 14

Can I customize suspend command in xfce4-session-logout?

Hi all.
I've read (and sometimes wrote) several things.

I'm here to try to improve suspend issue with Nvidia (no wake up after suspend).

My solution (as for many others) is to use:

sudo pm-suspend

I've add a file in sudoers.d/, so this command don't need password any more. So I can make a button with it, good.

And now the question is: how to put pm-suspend by default in my system (ubuntu20.04) for any suspend request?
I don't thinks it's possible like this.

So I change it to : "how to customize suspend command in xfce4-session-logout?"

I know I can remove action in it with xfconf-query, also ToZ said you can't add an action in xfce4-session-logout without hardcode.
(is it me or is their many questions about this button?)
Ok.
But what about modify?
I guess it's the same but I ask anyway.

I consider this as last solution, if no other way: 

For now, I've hide suspend in xfce4-session-logout (so no more accidental buggy suspend), and add a button to whiskermenu, by editing manually ~/.config/xfce4/panel/whiskermenu-1.rc, set  show-command-suspend= to true
and modify the suspend command like this: command-suspend=sudo pm-suspend.

PHEW! yikes
Am I to old or is this quite challenging? See this option waiting for me in ~/.config/xfce4/panel/whiskermenu-1.rc leave me with a strange filling: am I missing something? Why can't we do this with menu-editor?

Offline

#2 2022-12-20 02:19:57

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Can I customize suspend command in xfce4-session-logout?

Assuming you are running a systemd system, it looks like xfce4-session will use systemd to suspend. Can you check the suspend states that your computer supports:

cat /sys/power/state

Based on what I've read, I believe those are run in the order they are listed. Mine shows "freeze mem disk". It looks like pm-suspend uses "mem" - see: https://cgit.freedesktop.org/pm-utils/t … ns.in#n294.

On a hunch. can you edit /etc/systemd/sleep.conf, uncomment SuspendMode and set it mem?

SuspendMode=mem

You may need to restart to test.

For now, I've hide suspend in xfce4-session-logout (so no more accidental buggy suspend), and add a button to whiskermenu, by editing manually ~/.config/xfce4/panel/whiskermenu-1.rc, set  show-command-suspend= to true
and modify the suspend command like this: command-suspend=sudo pm-suspend.

PHEW! yikes
Am I to old or is this quite challenging? See this option waiting for me in ~/.config/xfce4/panel/whiskermenu-1.rc leave me with a strange filling: am I missing something? Why can't we do this with menu-editor?

You should do this from whiskermenu's Properties > Commands tab. The rc file will get overwritten with the settings there.


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 2022-12-20 12:36:39

Ha!
Member
Registered: 2022-12-19
Posts: 14

Re: Can I customize suspend command in xfce4-session-logout?

Very interesting, thanks!

My outputs:

:~$ cat /sys/power/state
freeze standby mem disk
:~$ sudo nano /etc/systemd/sleep.conf
(...)
[Sleep]
#AllowSuspend=yes
#AllowHibernation=yes
#AllowSuspendThenHibernate=yes
#AllowHybridSleep=yes
#SuspendMode=
#SuspendState=mem standby freeze
#HibernateMode=platform shutdown
#HibernateState=disk
#HybridSleepMode=suspend platform shutdown
#HybridSleepState=disk
#HibernateDelaySec=180min

So I change #SuspendMode= to SuspendMode=mem
Have to test now.
Damn, so simple...

You should do this from whiskermenu's Properties > Commands tab

I don't understand. Are you talking about MenuLibre (menu-editor)?

Offline

#4 2022-12-20 12:44:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Can I customize suspend command in xfce4-session-logout?

Ha! wrote:

You should do this from whiskermenu's Properties > Commands tab

I don't understand. Are you talking about MenuLibre (menu-editor)?

What I mean is, that if you want to change the command that is being run by the Whiskermenu suspend button, right-click the Whiskermenu and choose "Properties". Then on the Commands tab, you can specify which command to run when clicking on the Suspend button.


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

#5 2022-12-20 13:16:17

Ha!
Member
Registered: 2022-12-19
Posts: 14

Re: Can I customize suspend command in xfce4-session-logout?

right-click the Whiskermenu

Ow! yikes s**t! right-click the Whiskermenu... arrh
You just kill me... but thank you, I was missing something.
Big thanks!

Last edited by Ha! (2022-12-20 13:17:01)

Offline

#6 2022-12-20 13:21:07

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Can I customize suspend command in xfce4-session-logout?

I'm curious, did the change to sleep.conf solve the suspend issue for you?


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

#7 2022-12-20 13:32:44

Ha!
Member
Registered: 2022-12-19
Posts: 14

Re: Can I customize suspend command in xfce4-session-logout?

Mee too!

But I can't test: I don't have suspend option in xfce4-session-logout anymore!

I did:

:~$ xfconf-query -c xfce4-session -np '/shutdown/ShowSuspend' -t 'bool' -s 'true'

But don't comeback.

Maybe because of the change to sleep.conf?

Offline

#8 2022-12-20 13:35:19

Ha!
Member
Registered: 2022-12-19
Posts: 14

Re: Can I customize suspend command in xfce4-session-logout?

Maybe because of the change to sleep.conf?

That's it.
Comment the #SuspendMode=mem mediately give suspend option back in logout menu.

Offline

#9 2022-12-20 13:36:49

Ha!
Member
Registered: 2022-12-19
Posts: 14

Re: Can I customize suspend command in xfce4-session-logout?

I know I can remove action in it with xfconf-query, also ToZ said you can't add an action in xfce4-session-logout without hardcode.
(is it me or is their many questions about this button?)
Ok.
But what about modify?

So, no way to modify?

Offline

#10 2022-12-20 15:27:40

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Can I customize suspend command in xfce4-session-logout?

Interesting. In that same file, try uncommenting instead the SuspendState line and try each successive option in turn (mem, freeze, standby) to see if either of them work.

I don't see an option in xfce4-session to bypass systemd and use pm-suspend - I'm wondering if we can adjust systemd to use another suspend mode/state.


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

#11 2022-12-20 23:43:36

Ha!
Member
Registered: 2022-12-19
Posts: 14

Re: Can I customize suspend command in xfce4-session-logout?

Leaving SuspendMode= like this (emtpy and uncommented) also make suspend option back.
I'll try what you suggest.

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.015 seconds, 7 queries executed - Memory usage: 570.62 KiB (Peak: 587.46 KiB) ]