Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display won't suspend #10

Open
Xeboc opened this issue Nov 21, 2024 · 1 comment
Open

Display won't suspend #10

Xeboc opened this issue Nov 21, 2024 · 1 comment

Comments

@Xeboc
Copy link

Xeboc commented Nov 21, 2024

I cannot seem to get the displays to sleep on my Intel Nuc desktop. The swayidle command that this program builds doesn't seem to handle a condition where I have screen blanking enabled in the gdm config, but automatic suspend off.

There's no dpms off command as part of the timeout, only as part of the sleep commands. This is the swayidle command being generated:

swayidle -w timeout 60
export curr_brightness=$(light)
echo $curr_brightness | tee $XDG_RUNTIME_DIR/screen_brightness_old.var
if [ 1 -eq "$(echo "${curr_brightness} > 30" | bc)" ]; then
light -S 30
fi
resume light -S $(cat $XDG_RUNTIME_DIR/screen_brightness_old.var)
before-sleep swaymsg output '*' dpms off;$(trawlcat wm.program.lock "gtklock -d --background $(trawlcat regolith.lockscreen.wallpaper.file /dev/null)");playerctl -a pause;sleep 1
after-resume swaymsg output '*' dpms on lock $(trawlcat wm.program.lock "gtklock -d --background $(trawlcat regolith.lockscreen.wallpaper.file /dev/null)")

on_ac_power exits with 1, since there are no (or incorrect) hardware indicators for main power:

on_ac_power 

echo $?
1
dconf dump /org/gnome/settings-daemon/plugins/power/

power-button-action='suspend'
sleep-inactive-ac-type='nothing'
sleep-inactive-battery-type='nothing'

Rust is a little tricky for me to read and there aren't many comments in this code, so I can't quite spot the issue. It appears as though the actions for on ac power (idle_action_ac_opt) are checked against on_ac_power.

Maybe this program could use systemd-ac-power?

systemd-ac-power

echo $?
0

Or maybe it is something else? Any suggestions?

@kgilmer
Copy link
Member

kgilmer commented Nov 23, 2024

CC @SoumyaRanjanPatnaik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants