+#
+# Power button
+#
+set $locker swaylock && sleep 1
+
+set $mode_system System (l)ock, (e)xit sway, (s)uspend, (h)ibernate, (r)eboot, (S)hutdown
+mode "$mode_system" {
+ bindsym l exec $locker, mode "default"
+ bindsym e exec swaymsg exit, mode "default"
+ bindsym s exec $locker && systemctl suspend, mode "default"
+ bindsym h exec $locker && systemctl hibernate, mode "default"
+ bindsym r exec systemctl reboot, mode "default"
+ bindsym Shift+s exec systemctl poweroff -i, mode "default"
+
+ # back to normal: Enter, Escape, or q
+ bindsym Return mode "default"
+ bindsym Escape mode "default"
+ bindsym q mode "default"
+}
+bindsym XF86PowerOff mode "$mode_system"
+