#!/bin/sh # Lid-driven laptop panel handling. # # shikane is authoritative for output layout/scaling # (~/.config/shikane/config.toml + shikane-watchdog.timer). This script used to # run `swaymsg output eDP-1 enable` whenever the lid was open, which on every # `swaymsg reload` raced the shikane "External Display" profile (eDP-1 off) and # contributed to "Atomic commit failed: Device or resource busy" churn. # It now only ever disables. LAPTOP_OUTPUT="eDP-1" LID_STATE_FILE="/proc/acpi/button/lid/LID/state" read -r LS < "$LID_STATE_FILE" case "$LS" in *closed) swaymsg output "$LAPTOP_OUTPUT" disable ;; *open) : ;; # leave to shikane *) echo "Could not get lid state" >&2 ; exit 1 ;; esac