diff --git a/README.org b/README.org index f31050a..91541ed 100644 --- a/README.org +++ b/README.org @@ -3861,6 +3861,14 @@ adaptive_sync = false *** Lock Screen +**** Swayidle + +#+BEGIN_SRC conf :tangle swayidle/.config/swayidle/config +timeout 600 "~/.scripts/session.sh --lock" +before-sleep "~/.scripts/session.sh --lock" +lock "swaylock" +#+END_SRC + **** Swaylock #+BEGIN_SRC conf :tangle swaylock/.config/swaylock/config @@ -9053,6 +9061,7 @@ declare -a startup_array=(\ # Status Bar "$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) # Background Processes + "/usr/bin/swayidle" \ # Swayidle Idle Manager "/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon "$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon @@ -9080,6 +9089,7 @@ declare -a kill_startup_array=(\ # Status Bar "pkill waybar" \ # Background Processes + "pkill swayidle" \ "pkill polkit-gnome-au" \ "pkill kdeconnectd" \ "$HOME/.scripts/dunst.sh --off" \ @@ -9225,6 +9235,7 @@ stow-create: -S ssh \ -S starship \ -S swappy \ + -S swayidle \ -S swaylock \ -S swhkd \ -S syncthing \ @@ -9280,6 +9291,7 @@ stow-delete: -D ssh \ -D starship \ -D swappy \ + -D swayidle \ -D swaylock \ -D swaync \ -D swhkd \ @@ -9329,6 +9341,7 @@ stow-recreate: -R ssh \ -R starship \ -R swappy \ + -R swayidle \ -R swaylock \ -R swhkd \ -R syncthing \ @@ -9850,7 +9863,7 @@ main() { ;; --lock) notify-send "Session Control" "Locking Session" & - swaylock + loginctl lock-session ;; --sleep) notify-send "Session Control" "Going to Sleep" & diff --git a/dwl/.scripts/session.sh b/dwl/.scripts/session.sh index f6c6a4a..3263fc4 100755 --- a/dwl/.scripts/session.sh +++ b/dwl/.scripts/session.sh @@ -45,7 +45,7 @@ main() { ;; --lock) notify-send "Session Control" "Locking Session" & - swaylock + loginctl lock-session ;; --sleep) notify-send "Session Control" "Going to Sleep" & diff --git a/dwl/.scripts/wayland-startup.sh b/dwl/.scripts/wayland-startup.sh index e1b7e2d..3a2df07 100755 --- a/dwl/.scripts/wayland-startup.sh +++ b/dwl/.scripts/wayland-startup.sh @@ -3,6 +3,7 @@ declare -a startup_array=(\ # Status Bar "$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) # Background Processes + "/usr/bin/swayidle" \ # Swayidle Idle Manager "/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon "$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon @@ -30,6 +31,7 @@ declare -a kill_startup_array=(\ # Status Bar "pkill waybar" \ # Background Processes + "pkill swayidle" \ "pkill polkit-gnome-au" \ "pkill kdeconnectd" \ "$HOME/.scripts/dunst.sh --off" \ diff --git a/justfile b/justfile index 78e5dad..a4c01e6 100644 --- a/justfile +++ b/justfile @@ -50,6 +50,7 @@ stow-create: -S ssh \ -S starship \ -S swappy \ + -S swayidle \ -S swaylock \ -S swhkd \ -S syncthing \ @@ -105,6 +106,7 @@ stow-delete: -D ssh \ -D starship \ -D swappy \ + -D swayidle \ -D swaylock \ -D swaync \ -D swhkd \ @@ -154,6 +156,7 @@ stow-recreate: -R ssh \ -R starship \ -R swappy \ + -R swayidle \ -R swaylock \ -R swhkd \ -R syncthing \ diff --git a/swayidle/.config/swayidle/config b/swayidle/.config/swayidle/config new file mode 100644 index 0000000..7df1197 --- /dev/null +++ b/swayidle/.config/swayidle/config @@ -0,0 +1,3 @@ +timeout 600 "~/.scripts/session.sh --lock" +before-sleep "~/.scripts/session.sh --lock" +lock "swaylock"