knoebber / toggle-display

~/bin/toggle-display Commits Diff Raw
#!/bin/bash
intern=eDP1
extern=DP2


if xrandr | grep "$extern disconnected"; then
    xrandr --output "$intern" --auto --primary
    xrandr --output "$extern" --off
fi

if xrandr | grep "$extern connected"; then
    xrandr --output "$extern" --mode 1920x1080 --rate 119.98 --primary
    xrandr --output "$intern" --off
fi