You are not logged in.

#1 2017-06-29 17:44:00

Nektarios
Member
Registered: 2013-02-19
Posts: 90

XFCE auto suspend after X idle timeout

I am having issues to make xfc4 to automatilly suspend the computer after a set  idle session timeout. Manually suspending and resuming with systemd works great though.

I have light-dm, light-locker and xscreensaver installed. Here are the relevant configurations that come to mind:


xfce4-power-manager settings

/xfce4-power-manager/blank-on-ac                    6
/xfce4-power-manager/dpms-enabled                   true
/xfce4-power-manager/dpms-on-ac-off                 15
/xfce4-power-manager/dpms-on-ac-sleep               11
/xfce4-power-manager/general-notification           true
/xfce4-power-manager/inactivity-on-ac               15
/xfce4-power-manager/lock-screen-suspend-hibernate  true
/xfce4-power-manager/logind-handle-lid-switch       false
/xfce4-power-manager/presentation-mode              true
/xfce4-power-manager/show-tray-icon                 true
$ loginctl show-seat 
EnableWallMessages=yes
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch
DelayInhibited=sleep
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=suspend
IdleActionUSec=15min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
RemoveIPC=yes
RuntimeDirectorySize=1676759040
InhibitorsMax=8192
NCurrentInhibitors=2
SessionsMax=8192
NCurrentSessions=3
UserTasksMax=10813

logind conf:

[Login]
IdleAction=suspend
IdleActionSec=15m
$ xset -q
Keyboard Control:
  auto repeat:  on    key click percent:  0    LED mask:  00000002
  XKB indicators:
    00: Caps Lock:   off    01: Num Lock:    on     02: Scroll Lock: off
    03: Compose:     off    04: Kana:        off    05: Sleep:       off
    06: Suspend:     off    07: Mute:        off    08: Misc:        off
    09: Mail:        off    10: Charging:    off    11: Shift Lock:  off
    12: Group 2:     off    13: Mouse Keys:  off
  auto repeat delay:  200    repeat rate:  62
  auto repeating keys:  00ffffffdffffbbf
                        fadfffefffedffff
                        9fffffffffffffff
                        fff7ffffffffffff
  bell percent:  50    bell pitch:  400    bell duration:  100
Pointer Control:
  acceleration:  2/1    threshold:  4
Screen Saver:
  prefer blanking:  yes    allow exposures:  yes
  timeout:  0    cycle:  0
Colors:
  default colormap:  0x20    BlackPixel:  0x0    WhitePixel:  0xffffff
Font Path:
  /usr/share/fonts/misc/,/usr/share/fonts/TTF/,/usr/share/fonts/OTF/,/usr/share/fonts/Type1/,built-ins
DPMS (Energy Star):
  Standby: 300    Suspend: 360    Off: 420
  DPMS is Enabled
  Monitor is On

No matter what I have tried it never suspends by itself. I guess based on the output of loginctl show-seat, the IdleHint should be 'yes' instead of 'no' and this hint should come from xfce or some other program that keeps track of user activity. But I don't know which program that should be and why it doesn't work.

Please let me know if you know any solutions or have any pointers that can help me troubleshoot this issue.

Offline

#2 2017-06-29 19:04:59

toz
Member
Registered: 2011-10-28
Posts: 497

Re: XFCE auto suspend after X idle timeout

/xfce4-power-manager/presentation-mode              true

Try disabling (turning off) presentation mode.

You can also run xfce4-power-manager in debug mode to see exactly what is happening:

xfce4-power-manager -q
xfce4-power-manager --no-daemon --debug

Offline

#3 2017-06-29 21:11:05

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: XFCE auto suspend after X idle timeout

logind.conf requires a signal from the DE, not sure whether xfce supports this (or it's a gnome-only thing ...)
In doubt, try xautolock - despite the name, you can make it suspend the system (or do anything else)

Offline

#4 2017-07-03 19:44:56

Nektarios
Member
Registered: 2013-02-19
Posts: 90

Re: XFCE auto suspend after X idle timeout

I tried xautolock and it did locked an suspended my system. But how should I run this? as a startup script in xfce? as a systemd user unit? what? I feel that this is not the way suspension of sessions should be setup. I am confused, there are so many different utilities for locking and suspending: xfce4-power-manager, logind configuration, xflock4, xscreensaver (why?), xset, xautolock and god knows what else. All of them seem to do the same thing but  all of them fail miserably. I just want my session to lock and suspend the system after a set time and resume when I press a key on my keyboard. Is there a standard best practice for that?

(I would prefer logind if I was to choose)

Offline

#5 2017-07-03 20:29:24

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: XFCE auto suspend after X idle timeout

"But how should I run this?"
The one you prefer.

"I feel"
Sorry, not my expertise.

"xfce4-power-manager"
This should be what you want, no idea why it does not work.

"logind configuration"
relies on signals from the session, in this case *could* be backend to xfce4-power-manager, but i've no idea whether its used

"xflock4"
wrapper for various screensaver implementations

"xscreensaver (why?)"
Because it's the de-facto "standard" screensaver, probably predating every other and the availability of "desktop environments". Comes with a hell lot of animations to look at which are/were invoked by other screensaver implementations.

"xset"
is a generic tool to alter various parameters of the X11 server at runtime

"xautolock"
a generic tool to randomly fire actions when you've been lazy for some time.

None of these is like the other and only one actually deals with power settings - whatever they "seem" to you.

"all of them fail miserably"
How does that meet
"tried xautolock and it did locked an suspended my system"?

"Is there a standard best practice for that?"
You mean a standard that covers X11, wayland, gnome, kde, xfce, enlightenment, openbox, fluxbox, icewm and the console?
No.

"I would prefer logind"
logind cannot detect idleness. reason? look at the list above. you can send the idle or lock hint via dbus, but will still require "something" to detect the idleness (eg., guess what, xautolock)

Offline

#6 2017-07-03 22:38:42

Nektarios
Member
Registered: 2013-02-19
Posts: 90

Re: XFCE auto suspend after X idle timeout

seth wrote:

"But how should I run this?"
The one you prefer.

I'll go with systemd then, thanks.

"I feel"
Sorry, not my expertise.

"xfce4-power-manager"
This should be what you want, no idea why it does not work.

No idea here too, that's why I'm asking.

"xscreensaver (why?)"
Because it's the de-facto "standard" screensaver, probably predating every other and the availability of "desktop environments". Comes with a hell lot of animations to look at which are/were invoked by other screensaver implementations.

"xset"
is a generic tool to alter various parameters of the X11 server at runtime

"xautolock"
a generic tool to randomly fire actions when you've been lazy for some time.

None of these is like the other and only one actually deals with power settings - whatever they "seem" to you.

"all of them fail miserably"
How does that meet
"tried xautolock and it did locked an suspended my system"?

xflock4 is just a dump script trying to run commands that may or may not exist. As if that's not stupid enough, xflock4 tries to run xscreensaver, as if that makes any sense in some far away universe.

xautolock does the exact same inane thing, it locks the screen but also can be used to suspend the system too. And it also can have a "kil" time with a "killer" command, that does anything but "kill"ing. Absolutely no logical connection there, don't waste your time searching for it.

xset, as a general X configuration utility, among other things, configures the DPMS of monitors, but of course, it does not suspend the system, makes sense huh? No, neither did I think so.

You mean a standard that covers X11, wayland, gnome, kde, xfce, enlightenment, openbox, fluxbox, icewm and the console?

------------------

logind cannot detect idleness. reason? look at the list above. you can send the idle or lock hint via dbus, but will still require "something" to detect the idleness (eg., guess what, xautolock)


No, I mean a standard of how to use logind with xfce. I know exactly why it cannot detect idleness and the mechanism behind it, thank you very much. What to use to send that particular signal, is what I am asking for. What is the best practice. Is it autolock? great!! Any more details about it or should I code my own script and reinvent the wheel for the hundrendth thousandth time?

Offline

#7 2017-07-04 06:57:05

seth
Member
Registered: 2012-09-03
Posts: 51,017

Re: XFCE auto suspend after X idle timeout

reddit is here ...

Offline

#8 2017-07-05 17:39:18

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,845
Website

Re: XFCE auto suspend after X idle timeout

Nektarios, I appreciate that you are getting frustrated, but please take a moment to take a break and calm down. Ranting on the forums serves no purpose and only makes people less inclined to help you.

You say that xautolock worked for you, and the only problem now is that you need to autostart it. Whether this is a perfect solution for your problem isn't important -- it can still serve as a stopgap until you find or develop a 'perfect' solution. Can you elaborate on why this is not how you feel sessions should be suspended?


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#9 2017-07-05 21:29:18

Nektarios
Member
Registered: 2013-02-19
Posts: 90

Re: XFCE auto suspend after X idle timeout

WorMzy wrote:

Nektarios, I appreciate that you are getting frustrated, but please take a moment to take a break and calm down. Ranting on the forums serves no purpose and only makes people less inclined to help you.

I'm not really ranting, just pointing out how confusing the names and purposes of those utilities are, which results in a very hard configuration setup for no good reason. And when I get answers like the one from seth, that insults me, I get frustrated:

"I feel"
Sorry, not my expertise.

Esepecially after knowing that seth, didn't even read my OP where I specifically state that:

[T]he IdleHint should be 'yes' instead of 'no' and this hint should come from xfce or some other program that keeps track of user activity. But I don't know which program that should be and why it doesn't work.

but seth, goes on regardless and his first reply was:

logind.conf requires a signal from the DE, not sure whether xfce supports this (or it's a gnome-only thing ...)

....

You say that xautolock worked for you, and the only problem now is that you need to autostart it.

I still struggle with xautolock, I setup a user service unit for it to run when I logon to xfce but it doesn't work, it exists immediately with a "couldn't connect to" (sic) message. I guess it tries to run before xorg starts up. I might use the scripts startup mechanism of xfce instead. Also I couldn't manage to make it suspend the system again by running it manually. I am still trying to figure out what happens, it takes 10+ minutes of waiting each time I try it and I don't have that much time to spent. Is there a way to make this shorter (except than edting the source code of xautolock)?

Whether this is a perfect solution for your problem isn't important -- it can still serve as a stopgap until you find or develop a 'perfect' solution. Can you elaborate on why this is not how you feel sessions should be suspended?

I don't care if it's "perfect", I care if it suspends my system under all circumstances (e.g. user logged in, user not logged in yet, no user logged in at all etc). A correct solution should take care of all the cases, that's why I don't "feel" that a (xflock4) script that is executed as a locker and as a  screensaver (despite its name) and blindly tries to execute commands right and left, could handle all those cases. The only serious candidate, from a system design perspective, that I see fit for this is logind, but it seems that it isn't supported by xfce as it doesn't implement the idleHint signal. Any clues on that?

I really want to fix this as it is the only showstopper issue that prevents me from using xfce which, I really like.

Offline

#10 2017-07-05 21:33:12

Nektarios
Member
Registered: 2013-02-19
Posts: 90

Re: XFCE auto suspend after X idle timeout

toz wrote:

/xfce4-power-manager/presentation-mode              true

Try disabling (turning off) presentation mode.

You can also run xfce4-power-manager in debug mode to see exactly what is happening:

xfce4-power-manager -q
xfce4-power-manager --no-daemon --debug

I disabled the presentation mode but it didn't help. xfce power manager still does nothing. I'm testing out xautolock now, and if it fails, I'll run this on debug and post the results. Thanks for your tips.

Offline

#11 2017-07-06 19:58:48

adesh
Member
Registered: 2016-10-05
Posts: 167

Re: XFCE auto suspend after X idle timeout

XFCE user here, I don't use auto-suspend feature but saw this thread and gave it a try. I set xfce4-power-manager to suspend the system after 15 minutes of inactivity and it worked (I left some music playing in mpv and it stopped after 15 minutes while system going to sleep). To say, I'm not experiencing the issue you mentioned. I've never "configured" anything and system is running on defaults. I see IdleHint=yes in my loginctl output:

[01:18] addy@addy-pc <~>
--($)-- loginctl show-seat 
EnableWallMessages=no
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
IdleHint=yes
IdleSinceHint=0
IdleSinceHintMonotonic=0
BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key
InhibitDelayMaxUSec=5s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
RemoveIPC=yes
RuntimeDirectorySize=204460032
InhibitorsMax=8192
NCurrentInhibitors=1
SessionsMax=8192
NCurrentSessions=1
UserTasksMax=10813

I'm not using a locking solution now but in the past slock worked perfectly with my XFCE setup.
Also I'm using startx, not LightDM.

Last edited by adesh (2017-07-06 20:02:15)

Offline

#12 2019-11-12 23:21:43

seedship
Member
Registered: 2019-07-02
Posts: 3

Re: XFCE auto suspend after X idle timeout

I have this issue too. I have disabled presentation-mode. but I found that I have DelayInhibited=sleep in my loginctl show-seat, a setting the OP also has, and a setting @adesh doesn't have, so I'm guessing that is the cause. However, I looked at systemd documentation, and it did not say how to disable DelayInhibited. Does anyone know how to get rid of the DelayInhibited=sleep?

[seedship@triple-destinies ~]$ loginctl show-seat
EnableWallMessages=yes
NAutoVTs=6
KillUserProcesses=no
RebootToFirmwareSetup=no
RebootToBootLoaderMenu=18446744073709551615
IdleHint=no
IdleSinceHint=0
IdleSinceHintMonotonic=0
BlockInhibited=handle-power-key:handle-suspend-key:handle-hibernate-key:handle-lid-switch

DelayInhibited=sleep

InhibitDelayMaxUSec=5s
UserStopDelayUSec=10s
HandlePowerKey=poweroff
HandleSuspendKey=suspend
HandleHibernateKey=hibernate
HandleLidSwitch=suspend
HandleLidSwitchDocked=ignore
HoldoffTimeoutUSec=30s
IdleAction=ignore
IdleActionUSec=30min
PreparingForShutdown=no
PreparingForSleep=no
Docked=no
LidClosed=no
OnExternalPower=yes
RemoveIPC=yes
RuntimeDirectorySize=6732443648
InhibitorsMax=8192
NCurrentInhibitors=4
SessionsMax=8192
NCurrentSessions=1

Last edited by seedship (2019-11-12 23:22:53)

Offline

#13 2019-11-12 23:29:54

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: XFCE auto suspend after X idle timeout

Thanks for the contribution, but as this topic is very old I am closing it now.

https://wiki.archlinux.org/index.php/Co … bumping%22

Offline

Board footer

Powered by FluxBB