diff options
| author | coasteen <coasteen@proton.me> | 2026-07-09 10:42:28 +0330 |
|---|---|---|
| committer | coasteen <coasteen@proton.me> | 2026-07-09 10:42:28 +0330 |
| commit | 8cbadb61604667b407b53ee1258433994fa4765a (patch) | |
| tree | 97765fb29418fd6278fcb4cbb9760893afaf7a58 /local/bin/toggle-screens.sh | |
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 |
