You are not logged in.

#1 2015-04-04 21:33:58

ghostjoad
Member
Registered: 2015-03-27
Posts: 10

[Solved] systemd and suspension

Hello,

I'd like to know if there is a way to change the amount of time before suspension in Arch Linux, and to set it differently when the laptop is plugged in / on battery. I browsed the hibernate/suspend section of the wiki, but I wasn't able to find how to tune this parameter.

Thanks a lot for the help !

Last edited by ghostjoad (2015-04-06 17:07:50)

Offline

#2 2015-04-04 21:42:03

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 752

Re: [Solved] systemd and suspension

Depends on the desktop environment/power management tool you use. For example, in KDE/Plasma you have detailed settings, depending on if laptop is on AC, battery or low battery.

So, what governs such events in your system?

Offline

#3 2015-04-05 08:38:54

ghostjoad
Member
Registered: 2015-03-27
Posts: 10

Re: [Solved] systemd and suspension

I don't use any DE, I installed Awesome WM. I didn't install anything specific for power management. These events should be governed by acpid, right ?

Offline

#4 2015-04-05 10:17:20

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: [Solved] systemd and suspension

If you didn't configure anything, acpid won't do anything (chances are you don't have it installed in the first place). Systemd takes on some of the acpid tasks, but not all of them. So, first set up something for power management, then see how this can set up to do what you want.

Offline

#5 2015-04-05 13:03:15

Xabre
Member
From: Serbia
Registered: 2009-03-19
Posts: 752

Re: [Solved] systemd and suspension

systemd (logind - man logind.conf) or acpid, they both only provide an interface (in other words command and method for, say, suspending the system), however when will such command be invoked is handled by the power management tool.
Simply put, you need at least a script that will check if you're on battery, how much battery is left, how long have you been afk, and if all conditions are met, send systemctl suspend.
I know that users of Openbox often recommend xfce4-power-manager as a small and lightweight power daemon, would it work for you?

Offline

#6 2015-04-05 14:41:23

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,413
Website

Re: [Solved] systemd and suspension

logind has a suspend when idle feature, however it's a fixed value.

man logind.conf wrote:

Note that this requires that user sessions correctly report the idle status to the system. The system will execute the action after all sessions report that they are idle, no idle inhibitor lock is active, and subsequently, the time configured with IdleActionSec= (see below) has expired.

Some people use udev rules to change this value on battery events, but that requires restarting logind (and thus, losing all your work). You can however use systemd-inhibit to "block" suspend for a certain time. See the man page.

acpid directly listens to the kernel acpi events and I don't think these include anything related to "idle" time. It is however aware of battery/AC events. In either case the suggested xfce4-power-manager is a shortcut.

Last edited by Alad (2015-04-05 15:59:35)


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#7 2015-04-06 17:07:33

ghostjoad
Member
Registered: 2015-03-27
Posts: 10

Re: [Solved] systemd and suspension

Xfce4-power-manager works well, I didn't think about this before.

Thanks a lot for your help !

Offline

Board footer

Powered by FluxBB