diff options
| author | 2026-04-21 01:24:52 +0100 | |
|---|---|---|
| committer | 2026-04-21 01:24:52 +0100 | |
| commit | 061bbf62c1af95a8c51f040680c9610537cb3230 (patch) | |
| tree | bf1c400a5de3dc58460de9e2096006b3d1c2b77d /dot_config | |
| parent | 2a94cc096c647d06cf80b166f6b878609572dd1a (diff) | |
| download | dotfiles-061bbf62c1af95a8c51f040680c9610537cb3230.tar.gz dotfiles-061bbf62c1af95a8c51f040680c9610537cb3230.tar.bz2 dotfiles-061bbf62c1af95a8c51f040680c9610537cb3230.zip | |
sway: display-toggle re-enables laptop screen when no external present
Diffstat (limited to 'dot_config')
| -rwxr-xr-x | dot_config/sway/executable_display-toggle.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/dot_config/sway/executable_display-toggle.sh b/dot_config/sway/executable_display-toggle.sh index b0e4d17..265ab6b 100755 --- a/dot_config/sway/executable_display-toggle.sh +++ b/dot_config/sway/executable_display-toggle.sh @@ -9,6 +9,12 @@ LAPTOP=$(echo "$OUTPUTS" | jq -r '[.[] | select(.name | test("^eDP")) | .name] | EXTERNAL=$(echo "$OUTPUTS" | jq -r '[.[] | select(.name | test("^eDP") | not) | .name] | first // empty') if [ -z "$EXTERNAL" ]; then + # No external connected: make sure the laptop screen is on. This recovers + # from an earlier "laptop-off" state after the external was unplugged. + if [ -n "$LAPTOP" ]; then + swaymsg output "$LAPTOP" enable pos 0 0 || true + echo "laptop-only" >"$STATE_FILE" + fi [ -z "$1" ] && notify-send "Display" "No external display connected" exit 0 fi |
