diff --git a/utils/.local/bin/erctl b/utils/.local/bin/erctl new file mode 100755 index 0000000..7b06620 --- /dev/null +++ b/utils/.local/bin/erctl @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +# ericonr's script for system tasks + +# detect session manager; +# systemd -> systemctl +# non-systemd -> loginctl +command -v systemctl >/dev/null 2>&1 && CTL=systemctl +CTL=${CTL:-loginctl} + +exec $CTL "$@" diff --git a/wayland/.config/sway/config b/wayland/.config/sway/config index e76cfcf..57d2a19 100644 --- a/wayland/.config/sway/config +++ b/wayland/.config/sway/config @@ -42,8 +42,7 @@ bindsym $mod+Shift+c reload # Restart sway inplace (can be used to upgrade sway) bindsym $mod+Shift+r restart # Exit sway -set $exit_command "swaynag -t warning -m 'You pressed the exit shortcut.' -b 'Exit session' 'swaymsg exit' -b 'Suspend device' 'systemctl suspend' -b 'Shut down' 'poweroff'" -bindsym $mod+Shift+e exec $exit_command +bindsym $mod+Shift+e exec sway_exit_command ## Input settings input * { @@ -173,7 +172,7 @@ bindsym --locked $mod+Mod1+a output * dpms on bindsym --locked $mod+Mod1+z output * dpms off # Sleep when closed behavior # TODO: create script to make this multi-platform -bindswitch --reload lid:on exec systemctl suspend +bindswitch --reload lid:on exec erctl suspend ## Layout # Split in horizontal orientation diff --git a/wayland/.local/bin/sway_exit_prompt b/wayland/.local/bin/sway_exit_prompt new file mode 100755 index 0000000..dd83585 --- /dev/null +++ b/wayland/.local/bin/sway_exit_prompt @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +exec swaynag \ + -t warning \ + -m 'You pressed the exit shortcut.' \ + -b 'Exit session' 'swaymsg exit' \ + -b 'Suspend device' 'erctl suspend' \ + -b 'Shut down' 'erctl poweroff'