From 846bd16012006657bb68ff3adb2d3d2dc8cccd2d Mon Sep 17 00:00:00 2001 From: toniiz Date: Sun, 16 Jun 2024 19:28:06 -0700 Subject: [PATCH] add swayidle for iMac16,2 and added swaylock shortcut to sway/config as well as a lockman.sh script I found online --- configs/sway_g/iMac16,2/config | 7 +++++++ configs/sway_g/iMac16,2/lockman.sh | 9 +++++++++ configs/sway_g/iMac16,2/swayidle/config | 3 +++ 3 files changed, 19 insertions(+) create mode 100755 configs/sway_g/iMac16,2/lockman.sh create mode 100644 configs/sway_g/iMac16,2/swayidle/config diff --git a/configs/sway_g/iMac16,2/config b/configs/sway_g/iMac16,2/config index d807261..306dfde 100644 --- a/configs/sway_g/iMac16,2/config +++ b/configs/sway_g/iMac16,2/config @@ -107,6 +107,9 @@ bindsym $mod+space focus mode_toggle bindsym $mod+a focus parent bindsym $mod+r mode "resize" +# Hide waybar/enable +bindsym $mod+escape exec killall -SIGUSR1 waybar + mode "resize" { bindsym $left resize shrink width 20px bindsym $down resize grow height 20px @@ -122,6 +125,10 @@ bindsym Return mode "default" bindsym Escape mode "default" } +# Lock screen +set $lockman exec bash ~/.config/sway/lockman.sh +bindsym $mod+Shift+p exec $lockman + # includes include /etc/sway/config.d/* # swaysome config append diff --git a/configs/sway_g/iMac16,2/lockman.sh b/configs/sway_g/iMac16,2/lockman.sh new file mode 100755 index 0000000..82ad819 --- /dev/null +++ b/configs/sway_g/iMac16,2/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 550000 +# Kills last background task so idle timer doesn't keep running +#kill %% diff --git a/configs/sway_g/iMac16,2/swayidle/config b/configs/sway_g/iMac16,2/swayidle/config new file mode 100644 index 0000000..43ac96e --- /dev/null +++ b/configs/sway_g/iMac16,2/swayidle/config @@ -0,0 +1,3 @@ +exec swayidle -w \ + timeout 300 'swaylock -f -c 000000' \ + timeout 330 'swaymsg "output * dpms off"' \