diff --git a/.config/sway/config b/.config/sway/config index d346755..e2cace2 100644 --- a/.config/sway/config +++ b/.config/sway/config @@ -24,10 +24,6 @@ output * bg /usr/share/backgrounds/sway/Sway_Wallpaper_Blue_1920x1080.png fill # Workspaces set $ws1 1:C -# Assign wrkspaces for common apps -assign [class="^slack$"] $ws1 -assign [class="^microsoft teams - preview$"] $ws1 -for_window [class="^microsoft teams - preview$"] border none # Key bindings bindsym $mod+Return exec $term @@ -180,6 +176,20 @@ bindsym $mod+r mode "resize" # } #} +# --------------------------------------------------- # +# Screensaver + Locking +# --------------------------------------------------- # +set $lock swaylock -c 000000 +exec swayidle -w \ + timeout 300 $lock \ + timeout 600 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' \ + before-sleep $lock + +set $lockman exec bash ~/.config/sway/lockman.sh +bindsym $mod+Mod1+Ctrl+l $lockman +# --------------------------------------------------- # + exec_always ~/.config/waybar/waybar.sh #include /etc/sway/config.d/* diff --git a/.config/sway/lockman.sh b/.config/sway/lockman.sh new file mode 100644 index 0000000..f6d432c --- /dev/null +++ b/.config/sway/lockman.sh @@ -0,0 +1,9 @@ +#!/bin/sh +# Times the screen off and puts it to background +swayidle \ + timeout 10 'swaymsg "output * dpms off"' \ + resume 'swaymsg "output * dpms on"' & +# Locks the screen immediately +swaylock -c 000000 +# Kills last background task so idle timer doesn't keep running +kill %%