mirror of https://github.com/ericonr/dotfiles.git
Create erctl, clean up session management.
This commit is contained in:
parent
7f75aa0ab6
commit
6383fabcb8
|
@ -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 "$@"
|
|
@ -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
|
||||
|
|
|
@ -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'
|
Loading…
Reference in New Issue