Swayidle Configuration

- Add swayidle to startup
- Change session lock to use `loginctl`
- Swayidle interprets `loginctl lock-session` as `swaylock`
This commit is contained in:
Sravan Balaji
2024-10-13 17:37:09 -04:00
parent bf9e359b44
commit aecc181c01
5 changed files with 23 additions and 2 deletions

View File

@@ -3861,6 +3861,14 @@ adaptive_sync = false
*** Lock Screen *** 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 **** Swaylock
#+BEGIN_SRC conf :tangle swaylock/.config/swaylock/config #+BEGIN_SRC conf :tangle swaylock/.config/swaylock/config
@@ -9053,6 +9061,7 @@ declare -a startup_array=(\
# Status Bar # Status Bar
"$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) "$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration)
# Background Processes # Background Processes
"/usr/bin/swayidle" \ # Swayidle Idle Manager
"/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent
"/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon "/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon
"$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon "$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
@@ -9080,6 +9089,7 @@ declare -a kill_startup_array=(\
# Status Bar # Status Bar
"pkill waybar" \ "pkill waybar" \
# Background Processes # Background Processes
"pkill swayidle" \
"pkill polkit-gnome-au" \ "pkill polkit-gnome-au" \
"pkill kdeconnectd" \ "pkill kdeconnectd" \
"$HOME/.scripts/dunst.sh --off" \ "$HOME/.scripts/dunst.sh --off" \
@@ -9225,6 +9235,7 @@ stow-create:
-S ssh \ -S ssh \
-S starship \ -S starship \
-S swappy \ -S swappy \
-S swayidle \
-S swaylock \ -S swaylock \
-S swhkd \ -S swhkd \
-S syncthing \ -S syncthing \
@@ -9280,6 +9291,7 @@ stow-delete:
-D ssh \ -D ssh \
-D starship \ -D starship \
-D swappy \ -D swappy \
-D swayidle \
-D swaylock \ -D swaylock \
-D swaync \ -D swaync \
-D swhkd \ -D swhkd \
@@ -9329,6 +9341,7 @@ stow-recreate:
-R ssh \ -R ssh \
-R starship \ -R starship \
-R swappy \ -R swappy \
-R swayidle \
-R swaylock \ -R swaylock \
-R swhkd \ -R swhkd \
-R syncthing \ -R syncthing \
@@ -9850,7 +9863,7 @@ main() {
;; ;;
--lock) --lock)
notify-send "Session Control" "Locking Session" & notify-send "Session Control" "Locking Session" &
swaylock loginctl lock-session
;; ;;
--sleep) --sleep)
notify-send "Session Control" "Going to Sleep" & notify-send "Session Control" "Going to Sleep" &

View File

@@ -45,7 +45,7 @@ main() {
;; ;;
--lock) --lock)
notify-send "Session Control" "Locking Session" & notify-send "Session Control" "Locking Session" &
swaylock loginctl lock-session
;; ;;
--sleep) --sleep)
notify-send "Session Control" "Going to Sleep" & notify-send "Session Control" "Going to Sleep" &

View File

@@ -3,6 +3,7 @@ declare -a startup_array=(\
# Status Bar # Status Bar
"$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration) "$HOME/.config/dwl/waybar/launch.sh" \ # Waybar (dwl configuration)
# Background Processes # Background Processes
"/usr/bin/swayidle" \ # Swayidle Idle Manager
"/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent "/usr/libexec/polkit-gnome-authentication-agent-1" \ # GNOME Polkit Authentication Agent
"/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon "/usr/bin/kdeconnectd --replace" \ # KDE Connect Daemon
"$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon "$HOME/.scripts/dunst.sh --on" \ # Dunst Notification Daemon
@@ -30,6 +31,7 @@ declare -a kill_startup_array=(\
# Status Bar # Status Bar
"pkill waybar" \ "pkill waybar" \
# Background Processes # Background Processes
"pkill swayidle" \
"pkill polkit-gnome-au" \ "pkill polkit-gnome-au" \
"pkill kdeconnectd" \ "pkill kdeconnectd" \
"$HOME/.scripts/dunst.sh --off" \ "$HOME/.scripts/dunst.sh --off" \

View File

@@ -50,6 +50,7 @@ stow-create:
-S ssh \ -S ssh \
-S starship \ -S starship \
-S swappy \ -S swappy \
-S swayidle \
-S swaylock \ -S swaylock \
-S swhkd \ -S swhkd \
-S syncthing \ -S syncthing \
@@ -105,6 +106,7 @@ stow-delete:
-D ssh \ -D ssh \
-D starship \ -D starship \
-D swappy \ -D swappy \
-D swayidle \
-D swaylock \ -D swaylock \
-D swaync \ -D swaync \
-D swhkd \ -D swhkd \
@@ -154,6 +156,7 @@ stow-recreate:
-R ssh \ -R ssh \
-R starship \ -R starship \
-R swappy \ -R swappy \
-R swayidle \
-R swaylock \ -R swaylock \
-R swhkd \ -R swhkd \
-R syncthing \ -R syncthing \

View File

@@ -0,0 +1,3 @@
timeout 600 "~/.scripts/session.sh --lock"
before-sleep "~/.scripts/session.sh --lock"
lock "swaylock"