From b3da97bc3038bbad8d4588e546b562952a2e8a27 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Sat, 17 Jun 2023 01:34:05 -0400 Subject: [PATCH] Added launcher for waylock --- dot_config/river/executable_init.tmpl | 6 +++--- dot_local/bin/executable_swayidle-laptop | 2 +- dot_local/bin/executable_waylock-launcher | 16 ++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 dot_local/bin/executable_waylock-launcher diff --git a/dot_config/river/executable_init.tmpl b/dot_config/river/executable_init.tmpl index c2a5d67..1fad88e 100644 --- a/dot_config/river/executable_init.tmpl +++ b/dot_config/river/executable_init.tmpl @@ -172,7 +172,7 @@ riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad tap-button-map left-right- riverctl input pointer-2-7-SynPS/2_Synaptics_TouchPad scroll-method two-finger # Lid switch -riverctl map-switch normal lid close "waylock -fork-on-lock -init-color 0x000000" +riverctl map-switch normal lid close 'waylock-launcher' {{- end }} ### "rule-add" not implemented yet??? @@ -204,12 +204,12 @@ kanshi & dunst & {{- if eq .chezmoi.hostname "hydrus" }} swaybg -m fill -i $HOME/Pictures/Wallpapers/dark-forest-path.jpg & -swayidle -w timeout 600 "waylock -fork-on-lock -init-color 0x000000" & +swayidle -w timeout 300 'waylock-launcher' & {{- else if eq .chezmoi.hostname "helix" }} swaybg -m center -i "$HOME/Pictures/Wallpapers/Mountain Retreat.jpg" & swayidle-laptop & {{- else }} -swayidle -w timeout 600 "waylock -fork-on-lock -init-color 0x000000" & +swayidle -w timeout 300 'waylock-launcher' & {{- end }} gammastep -r & waybar-launcher & diff --git a/dot_local/bin/executable_swayidle-laptop b/dot_local/bin/executable_swayidle-laptop index cb9cad3..d8bcfd2 100644 --- a/dot_local/bin/executable_swayidle-laptop +++ b/dot_local/bin/executable_swayidle-laptop @@ -23,7 +23,7 @@ swayidle -w \ resume 'light -I' \ timeout 900 'light -I && wlr-randr --output eDP-1 --off' \ resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \ - timeout 3600 'loginctl suspend' \ + timeout 3600 'loginctl suspend-then-hibernate' \ resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \ 2>&1 | "$LOG_FILE_LOCK" & disown diff --git a/dot_local/bin/executable_waylock-launcher b/dot_local/bin/executable_waylock-launcher new file mode 100644 index 0000000..ed6ad7e --- /dev/null +++ b/dot_local/bin/executable_waylock-launcher @@ -0,0 +1,16 @@ +#!/bin/bash + +START_TIME=`date +"%b %d, %Y %T"` +echo "--- ${START_TIME} ---" > "${XDG_STATE_HOME}"/waylock.log + +if pgrep -u $UID -x waylock >/dev/null; then + exit 1 +else + waylock \ + -fork-on-lock \ + -init-color 0x000000 \ + -input-color 0x323d43 \ + -fail-color 0xe26c6e \ + 2>&1 | tee -a "${XDG_STATE_HOME}"/waylock.log & disown +fi +