Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-06-04 11:24:46

Gaff
Member
Registered: 2018-06-04
Posts: 5

Power down completely after inactvity

Hi,

How can I configure a session to shutdown completely after a period inactivity? System Sleep Mode seems close to what I need - but it only supports Suspend and Hibernate, not shutdown. (well on my computer anyway).

Thanks!

Offline

#2 2018-06-04 13:13:33

alcornoqui
Member
Registered: 2014-07-28
Posts: 317

Re: Power down completely after inactvity

What distro?

I wouldn't know how to do it from within Xfce's GUI, but this 2014 Ask Ubuntu thread mentions some options, using xscreensaver, xprintidle, or custom scripts.

PS: Ah, I just found Autopoweroff! Seems to be what you're looking for: https://github.com/deragon/autopoweroff

Autopoweroff is a daemon that is started at boot time, and which function is to run a command at a specific time, but only if some conditions are met. Originally, this application would only shutdown the computer, thus its name, but now it can suspend, hibernate, or run any custom command provided by the user.

This software is meant for the Linux operating system only. It should work on any modern Linux distribution. Deb and RPM packages are available.

The computer will execute the command (suspend by default) if all the above conditions are met:

    Any hosts that the computer is dependent on is not answering ping anymore.
    No keyboard or mouse activity has been detected on the computer for a while.
    The user has not disabled Autopoweroff.

Welcome to the forum!

Offline

#3 2018-06-05 08:34:34

Gaff
Member
Registered: 2018-06-04
Posts: 5

Re: Power down completely after inactvity

I'm using XUbuntu (18.04)

Thanks for the autopoweroff suggestion - it's a pretty good one! However there are a couple of (minor) issues. Firstly it uses 'gksu' which is deprecated. Secondly it powers off after a period of no user input (rather than following the xfce rules) which means that it will kick in even if you are watching a video (and conversely if a child / cat hammers on the lock screen it won't kick in).

I'll try the xscreensaver idea next, that has potential - though xscreensaver is pretty out of date these days too.


I noticed however that the KDE equivalent of xfce4-power-manager does support shutdown. Does anyone know if it's possible to add this as an option to the xfce version?

Last edited by Gaff (2018-06-05 08:53:33)

Offline

#4 2018-06-05 14:26:03

Gaff
Member
Registered: 2018-06-04
Posts: 5

Re: Power down completely after inactvity

I've dug into this waaay too much now. Here's what I found:

* xfce4-power-manager has an internal eggtimer that uses the Xwindows IDLETIME counter to determine if it needs to take an action.
* With a little work the app could be extended to include options for power down on idle. Though I'm not sure I'm up for it right now.
* With systemd the app emits d-bus signals to hibernate / shutdown - which I guess other apps could listen for.
* The power app will also lock the screen via d-bus or via a script depending on the system - again I guess one could listen for this.

All that is rather complicated. The simple options are:

* xscreensaver should work, but it's pretty end-of-life. Nobody uses screensavers anymore.
* xautolock / xidle are simple tools that run a command after an idle timeout - and thus is a neat solution to the problem even if it's duplicating the work that xfce4-power-manager does.

Last edited by Gaff (2018-06-06 08:22:21)

Offline

#5 2018-06-05 23:36:41

alcornoqui
Member
Registered: 2014-07-28
Posts: 317

Re: Power down completely after inactvity

Gaff wrote:

* With a little work the app could be extended to include options for power down on idle. Though I'm not sure I'm up for it right now.

Thanks for the info. I passed by How does ubuntu determine inactivity before suspending? but the eggtime function was new to me, nice find!

I think there's a bit of a disconnect between the forum and the Xfce devs, but I'm sure that now that you have it straight, this merits a direct question in the mailing list or a feature request in Bugzilla.

If you make any of the solutions work, please tell us!

Offline

Board footer

Powered by FluxBB