summaryrefslogtreecommitdiff
path: root/local/bin/toggle-screens.sh
blob: dcda9f3783553707d29f9f584f0e94e288226f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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