Update stuff for screen lock

This commit is contained in:
2025-11-27 03:12:08 -08:00
parent a3aba45b6e
commit 6da1ad41b5
3 changed files with 40 additions and 13 deletions

17
laptop-lid-daemon Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env zsh
acpi_listen | while read event; do
let num_outputs="$(wlr-randr --json | jq 'length')"
if ((num_outputs <= 1)); then
kanshictl switch default
else
case "${event}" in
'button/lid LID open')
kanshictl switch docked-open
;;
'button/lid LID close')
kanshictl switch docked-closed
;;
esac
fi
done