mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-22 09:53:10 -05:00
Compare commits
No commits in common. "37a45f20758ff2f5c201c46571eb8e656b73b668" and "53eee27a42b36b53000810a584d06b6bd70c190d" have entirely different histories.
37a45f2075
...
53eee27a42
4 changed files with 42 additions and 56 deletions
|
@ -272,8 +272,8 @@ rivertile -view-padding 4 -outer-padding 4 -main-ratio .55 &
|
|||
dbus-update-activation-environment WAYLAND_DISPLAY XDG_CURRENT_DESKTOP=river &
|
||||
/usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1 &
|
||||
kanshi &
|
||||
idle-launcher &
|
||||
pipewire-launcher &
|
||||
swayidle-launcher &
|
||||
yambar-launcher &
|
||||
dunst &
|
||||
gammastep -r &
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
#!/bin/sh
|
||||
|
||||
time=$(date +"%b %d, %Y %T")
|
||||
log_file=$XDG_STATE_HOME/idle.log
|
||||
|
||||
echo "--- $time ---" > "$log_file"
|
||||
|
||||
# kill process if already running
|
||||
user=$(id -u)
|
||||
pid=$(ps -u "$user" | awk '/\<swayidle\>/ {print $1}')
|
||||
if [ "$pid" != "" ]; then
|
||||
echo "Sending SIGTERM to swayidle." >> "$log_file"
|
||||
kill "$pid"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
pid=$(ps -u "$user" | awk '/\<swayidle\>/ {print $1}')
|
||||
if [ "$pid" != "" ]; then
|
||||
echo "Sending SIGKILL to swayidle." >> "$log_file"
|
||||
kill -9 "$pid"
|
||||
sleep 1
|
||||
fi
|
||||
|
||||
{{ if eq .chezmoi.hostname "helix" -}}
|
||||
# dim: 2m, lock: 5m, display: 15m, suspend: 1h
|
||||
brightness="/sys/class/backlight/amdgpu_bl1/brightness"
|
||||
prev_brightness="${XDG_STATE_HOME}/prev_brightness"
|
||||
swayidle -w \
|
||||
timeout 120 "cat $brightness > $prev_brightness && echo 1 > $brightness" \
|
||||
resume "cat $prev_brightness > $brightness" \
|
||||
timeout 300 'waylock-launcher' \
|
||||
resume "cat $prev_brightness > $brightness" \
|
||||
timeout 900 "cat $prev_brightness > $brightness && wlr-randr --output eDP-1 --off" \
|
||||
resume "wlr-randr --output eDP-1 --on && kanshictl reload" \
|
||||
timeout 3600 "loginctl suspend-then-hibernate" \
|
||||
resume "wlr-randr --output eDP-1 --on && kanshictl reload" \
|
||||
lock "waylock-launcher" \
|
||||
before-sleep "waylock-launcher" \
|
||||
2>&1 | tee -a "$log_file" &
|
||||
{{- else if eq .chezmoi.hostname "hydrus" }}
|
||||
# lock: 5m, display: 15m
|
||||
swayidle -w \
|
||||
timeout 300 'waylock-launcher' \
|
||||
timeout 900 'kanshictl switch dual-off' \
|
||||
resume 'kanshictl switch dual' \
|
||||
lock 'waylock-launcher' \
|
||||
before-sleep 'waylock-launcher' \
|
||||
2>&1 | tee -a "$log_file" &
|
||||
{{- else }}
|
||||
# lock after 5m
|
||||
swayidle -w \
|
||||
timeout 300 'waylock-launcher' \
|
||||
2>&1 | tee -a "$log_file" &
|
||||
{{ end }}
|
39
dot_local/bin/executable_swayidle-launcher.tmpl
Normal file
39
dot_local/bin/executable_swayidle-launcher.tmpl
Normal file
|
@ -0,0 +1,39 @@
|
|||
#!/bin/sh
|
||||
|
||||
time=$(date +"%b %d, %Y %T")
|
||||
log_file=$XDG_STATE_HOME/swayidle.log
|
||||
|
||||
echo "--- $time ---" > "$log_file"
|
||||
|
||||
# kill running processes
|
||||
killall -q swayidle
|
||||
|
||||
{{ if eq .chezmoi.hostname "helix" -}}
|
||||
# dim: 2m, lock: 5m, display: 15m, suspend: 1h
|
||||
swayidle -w \
|
||||
timeout 120 'light -O && light -S .1' \
|
||||
resume 'light -I' \
|
||||
timeout 300 'waylock-launcher' \
|
||||
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-then-hibernate' \
|
||||
resume 'wlr-randr --output eDP-1 --on && kanshictl reload' \
|
||||
lock 'waylock-launcher' \
|
||||
before-sleep 'waylock-launcher' \
|
||||
2>&1 | tee -a "$log_file" &
|
||||
{{- else if eq .chezmoi.hostname "hydrus" }}
|
||||
# lock: 5m, display: 15m
|
||||
swayidle -w \
|
||||
timeout 300 'waylock-launcher' \
|
||||
timeout 900 'kanshictl switch dual-off' \
|
||||
resume 'kanshictl switch dual' \
|
||||
lock 'waylock-launcher' \
|
||||
before-sleep 'waylock-launcher' \
|
||||
2>&1 | tee -a "$log_file" &
|
||||
{{- else }}
|
||||
# lock after 5m
|
||||
swayidle -w \
|
||||
timeout 300 'waylock-launcher' \
|
||||
2>&1 | tee -a "$log_file" &
|
||||
{{ end }}
|
|
@ -15,10 +15,11 @@ river_has_update=$(echo "$aur_updates" | grep -c 'river-git')
|
|||
zls_has_update=$(echo "$aur_updates" | grep -c 'zls-git')
|
||||
|
||||
if [ "$river_has_update" -ne 0 ] && [ "$zls_has_update" -ne 0 ]; then
|
||||
zigup master
|
||||
paru -Syu --exclude river-git
|
||||
zigup 0.11.0
|
||||
paru -S river-git
|
||||
zigup master
|
||||
paru -Syu --ignore river-git
|
||||
elif [ "$river_has_update" -ne 0 ]; then
|
||||
zigup 0.11.0
|
||||
paru -Syu
|
||||
|
|
Loading…
Reference in a new issue