about summary refs log tree commit diff
path: root/mon
blob: 8a5e667d5001f7ac16589786d6f16ba141390d8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

if command -v xrandr >/dev/null 2>&1; then
    if xrandr | grep "VGA.* connected [0-9]*x[0-9]*+[0-9]*+[0-9]*" >/dev/null 2>&1; then
        xrandr \
            --output VGA1 --off
    else
        xrandr \
            --output LVDS1 --auto \
            --output VGA1 --auto --right-of LVDS1 --rotate left
    fi
fi

Consider giving Nix/NixOS a try! <3