You are not logged in.
I've been trying to configure Sway WM to execute the poweroff command and shutdown the system when the lid is closed, for this i used the
bindswitch lid:on --locked --nowarn --reload exec poweroff line in my configuration, i tried the same without the "--locked" and the "--reload" flags but that didn't happen either.
When i close the lid, sway enters a suspend state and executes the swaylock instead of shutting down, i've tried to stop this by commenting out the sway lock configuration that i had :
# exec swayidle -w \
# timeout 300 'swaylock -f -c 2c3639' \
# timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
# before-sleep 'swaylock -f -c 2c3639 --indicator-radius 70 --indicator-thickness 15 --inside-color 2c3639'\but even then, it is still locking the screen, i thought maybe it was a permission issue, i made sure that the user i'm using sway with, can run the command "poweroff" without sudo, i tried it in the terminal and it works well, no password needed, the computer shuts down, but it doesn't seem to work when used in the the sway wm configuration.
I'm the attaching the sway configuration here
Last edited by anicearchnewbie (2023-06-09 06:24:40)
Offline
from https://wiki.archlinux.org/title/Sway#C … eybindings:
Note: Systemd handles some special keys like the power key and lid open as well as close events. These may interfere with the ones configured in sway. See loginctl(1) and logind.conf(5) for details on how to configure them in systemd.
So what you want to do is edit /etc/systemd/logind.conf and replace the #HandleLidSwitch=suspend with:
HandleLidSwitch=poweroff
you might also want to edit the following 2 lines.
Last edited by jl2 (2023-06-08 11:39:35)
Why I run Arch? To "BTW I run Arch" the guy one grade younger.
And to let my siblings and cousins laugh at Arsch Linux...
Offline
That worked flawlessly. Thanks a lot, I'm marking this topic as solved.
Offline