Created
August 7, 2016 17:41
-
-
Save pdalpra/584d2d8ee7a6762665e8770ce5b64356 to your computer and use it in GitHub Desktop.
auto_monitor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export DISPLAY=:0 | |
export XAUTHORITY=/home/pdalpra/.Xauthority | |
function mirror() { | |
xrandr --output eDP1 --dpi 168 --output DP1 --mode 1920x1080 --scale 1.67x1.67 | |
} | |
function single() { | |
xrandr --output DP1 --off | |
xrandr --output eDP1 --dpi 168 | |
} | |
xrandr | grep "^DP1 connected" &> /dev/null && mirror || single | |
i3-msg -q 'restart' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment