Various changes to desktop configuration
This commit is contained in:
17
machines/desktop/config/sway/toggle-hdmi.sh
Executable file
17
machines/desktop/config/sway/toggle-hdmi.sh
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
OUTPUT="HDMI-A-2"
|
||||
|
||||
active="$(swaymsg -t get_outputs -r \
|
||||
| jq -r --arg o "$OUTPUT" '.[] | select(.name==$o) | .active')"
|
||||
|
||||
case "$active" in
|
||||
true) swaymsg output "$OUTPUT" disable ;;
|
||||
false) swaymsg output "$OUTPUT" enable ;;
|
||||
*)
|
||||
printf 'Output %s not found or jq parse error\n' "$OUTPUT" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user