add lid stuff

This commit is contained in:
Bartal Laearsson
2026-06-30 10:09:40 +01:00
parent 7dcf80b5e9
commit a27b3c9e96
4 changed files with 89 additions and 0 deletions
+4
View File
@@ -9,6 +9,10 @@ font pango:DejaVu Sans Mono 10
output * scale 1
output * bg ~/.config/sway/tux.png fill
# Disable the laptop panel while the lid is closed.
bindswitch --reload lid:on exec ~/.config/sway/scripts/lid-output off
bindswitch --reload lid:off exec ~/.config/sway/scripts/lid-output on
input type:keyboard {
xkb_layout fo
xkb_model pc105
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail
state="${1:-}"
internal_output="$(
swaymsg -t get_outputs -r |
jq -r '.[] | select(.name | test("^(eDP|LVDS)")) | .name' |
head -n 1
)"
if [ -z "$internal_output" ]; then
exit 0
fi
case "$state" in
off) swaymsg output "$internal_output" disable ;;
on) swaymsg output "$internal_output" enable ;;
*) exit 2 ;;
esac