06-01-2021, 01:26 PM
(05-30-2021, 10:35 PM)rimaille Wrote: Hi, dont know for i3, on sway i did :Hi. I did 1 and for 2 I added this line to the shutdown code:
1/ inhibit powerbutton in systemd/logind.conf
HandlePowerKey=ignore
2/ sway/config
# power button
bindsym XF86PowerOff exec ~/bin/wayland_toggle_screen.sh
3/ with wayland_toggle_screen.sh :
#!/bin/sh
read lcd < /tmp/lcd
if [ "$lcd" -eq "0" ]; then
swaymsg "output * dpms on"
echo 1 > /tmp/lcd
else
swaymsg "output * dpms off"
echo 0 > /tmp/lcd
fi
it works nice (powerbutton does switch screen on/off)
# Set shut down, restart and locking features
bindsym $mod+0 mode "$mode_system"
bindsym XF86PowerOff mode "$mode_system"
My only thought is maybe its a different key code on ANSI keyboard?