dotfiles/.scripts/toggleMonitor

13 lines
281 B
Bash
Executable File

#!/bin/bash
primary=DP-1
secondary=HDMI-0
if xrandr | grep "$secondary connected 1920x1080"; then
echo "Turing second monitor off"
xrandr --output "$secondary" --off
else
echo "Turing second monitor on"
xrandr --output "$secondary" --left-of "$primary" --auto
fi