diff options
Diffstat (limited to 'local/bin/toggle-screens.sh')
| -rwxr-xr-x | local/bin/toggle-screens.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/local/bin/toggle-screens.sh b/local/bin/toggle-screens.sh new file mode 100755 index 0000000..dcda9f3 --- /dev/null +++ b/local/bin/toggle-screens.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +outputs_json="$(niri msg --json outputs)" + +echo "$outputs_json" | jq -c '.[]' | while read -r out; do + name=$(echo "$out" | jq -r '.name') + dpms=$(echo "$out" | jq -r '.dpms') + + if [ "$dpms" = "On" ]; then + echo "Turning off $name" + niri msg output "$name" dpms off + fi +done |
