Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SOLVED] Suspend system after X minutes

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
mafsi
Posts: 14
Joined: 2014-02-07 06:39
Has thanked: 3 times
Been thanked: 1 time

[SOLVED] Suspend system after X minutes

#1 Post by mafsi »

I have an HP PowerBook 440 G4 with Debian Bullseye & BSPWM installed. My locker is lightdm with slick-greeter without a screensaver.

My xset q says:

Code: Select all

DPMS (Energy Star):
  Standby: 600    Suspend: 600    Off: 600
  DPMS is Enabled
  Monitor is On
  
I installed xfce4-power-manager in order to put my laptop in suspend mode after a certain period of time, but it only turned off my monitor, so I uninstalled since I get this by default without the power manager.

So, I want to suspend my laptop after a certain amount of inactivity, as I can get with a power manager in a desktop environment, i.e. after X minutes on battery and after X minutes on AC.

How can I achieve this?
Last edited by mafsi on 2022-10-06 10:16, edited 1 time in total.

User avatar
FreewheelinFrank
Global Moderator
Global Moderator
Posts: 2082
Joined: 2010-06-07 16:59
Has thanked: 38 times
Been thanked: 225 times

Re: Suspend system after X minutes

#2 Post by FreewheelinFrank »

Did you use the right tab in xfce4-power-manager? There are settings for mains/battery on my laptop, but I'm on my desktop at the moment. As far as I remember, the laptop also suspends after a certain time. I will check the next time I turn it on.

Image

Works for me on the desktop. I have never touched xset; a cursory glance suggests xfce4-power-manager should override xset settings:

https://wiki.archlinux.org/title/Displa ... _Signaling

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: Suspend system after X minutes

#3 Post by canci »

xfce4-power-manager has to be autorun by your window manager. It's not like in Xfce where there's a session. You have to put the executable into .xinitrc or .xsession if you're using a display manager.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

mafsi
Posts: 14
Joined: 2014-02-07 06:39
Has thanked: 3 times
Been thanked: 1 time

Re: Suspend system after X minutes

#4 Post by mafsi »

canci wrote: 2022-10-06 09:20 xfce4-power-manager has to be autorun by your window manager. It's not like in Xfce where there's a session. You have to put the executable into .xinitrc or .xsession if you're using a display manager.
I don't have .xsession either .xinitrc, I have .xsession-errors. Should I create one?
I put it in bspwm script along with sxhkd and others. No effect.

Code: Select all

#! /bin/sh

# killall -q nm-applet
# nm-applet &

# Disable tapping & scrooling for 1 sec after each key is pressed
killall -q syndaemon
syndaemon -i 2 -K -R &

killall -q volumeicon
volumeicon &

killall -q redshift-gtk
redshift-gtk &

# xfce4-power-manager &

## Keybinding & Language
pgrep -x sxhkd > /dev/null || sxhkd &

setxkbmap -layout "us,ro" -variant ",std" -option "grp:menu_toggle" &

## Compositor
# picom --config $HOME/.config/picom/picom.conf --experimental-backends -b &
picom -b &

## Wallpaper
# nitrogen --restore &
nitrogen --random --set-scaled /PERSONAL/DATA/wallpapers/ &

#xfce4-power-manager &
## Polybar
# killall -q polybar &
$HOME/.config/polybar/launch.sh &

## Notification
dunst &

## Cursor speed
xset r rate 200 100

# Workspace
bspc monitor eDP-1 -d I II III IV V VI VII VIII IX X
....

Last edited by mafsi on 2022-10-06 09:30, edited 1 time in total.

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: Suspend system after X minutes

#5 Post by canci »

Or maybe you use another autostart script. Doesn't matter as long as the power manager is running in the background when you log in.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

mafsi
Posts: 14
Joined: 2014-02-07 06:39
Has thanked: 3 times
Been thanked: 1 time

Re: Suspend system after X minutes

#6 Post by mafsi »

canci wrote: 2022-10-06 09:30 Or maybe you use another autostart script. Doesn't matter as long as the power manager is running in the background when you log in.
I'll give another shot. I'll install it again and test it & come back with an answer.

mafsi
Posts: 14
Joined: 2014-02-07 06:39
Has thanked: 3 times
Been thanked: 1 time

Re: Suspend system after X minutes

#7 Post by mafsi »

@canci It works. It seems that I set the power manager to presentation mode, and that inhibit to suspend. Thanks a lot.

Post Reply