mirror of
https://codeberg.org/andyscott/dotfiles.git
synced 2024-12-22 01:43:10 -05:00
Add xidlehook-desktop, logging for xidlehook scripts
This commit is contained in:
parent
e97a808f38
commit
de23ad58bf
3 changed files with 16 additions and 4 deletions
|
@ -83,6 +83,6 @@ cbatticon -u 20 -i standard -c "loginctl suspend" &
|
||||||
sleep 5 && pa-notify -t 3 &
|
sleep 5 && pa-notify -t 3 &
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if eq .chezmoi.hostname "hydrus"}}
|
{{- if eq .chezmoi.hostname "hydrus"}}
|
||||||
xidlehook --not-when-audio --not-when-fullscreen --timer 360 "xset s activate" "" &
|
$HOME/.local/bin/xidlehook-desktop &
|
||||||
$HOME/.local/bin/dual-polybar-launcher &
|
$HOME/.local/bin/dual-polybar-launcher &
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
10
dot_local/bin/executable_xidlehook-desktop
Normal file
10
dot_local/bin/executable_xidlehook-desktop
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Wait on pipewire or "--not-when-audio" will break everything
|
||||||
|
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
|
# lock screen after 10 minutes
|
||||||
|
echo "---" | tee -a /tmp/xidlehook.log
|
||||||
|
xidlehook --not-when-audio --not-when-fullscreen \
|
||||||
|
--timer 600 "xset s activate" "" \
|
||||||
|
2>&1 | tee -a /tmp/xidlehook.log & disown
|
|
@ -4,7 +4,9 @@
|
||||||
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
until pgrep -u $UID -x pipewire-pulse >/dev/null; do sleep 1; done
|
||||||
|
|
||||||
# dim screen after 2 minutes, lock screen after 10, suspend after an hour
|
# dim screen after 2 minutes, lock screen after 10, suspend after an hour
|
||||||
|
echo "---" | tee -a /tmp/xidlehook.log
|
||||||
xidlehook --not-when-audio --not-when-fullscreen \
|
xidlehook --not-when-audio --not-when-fullscreen \
|
||||||
--timer 120 "killall -q redshift && xrandr --output eDP-1 --brightness .1" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
--timer 120 "killall -q redshift && xrandr --output eDP-1 --brightness .1" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
||||||
--timer 480 "xset s activate" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
--timer 480 "xset s activate" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
||||||
--timer 3000 "loginctl suspend" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" &
|
--timer 3000 "loginctl suspend" "xrandr --output eDP-1 --brightness 1 && redshift -r & disown" \
|
||||||
|
2>&1 | tee -a /tmp/xidlehook.log & disown
|
||||||
|
|
Loading…
Reference in a new issue