Skip to content

Instantly share code, notes, and snippets.

@kieranajp
Created April 7, 2018 20:12
Show Gist options
  • Save kieranajp/ca4daadae4a47551ad45c1ad22346f1a to your computer and use it in GitHub Desktop.
Save kieranajp/ca4daadae4a47551ad45c1ad22346f1a to your computer and use it in GitHub Desktop.
Connect / disconnect external 4k monitor with xrandr (for use in awesomewm)
#!/bin/bash
connect=1
while getopts "d" opt; do
case "$opt" in
d)
connect=0
esac
done
if [ "$connect" -eq 1 ]; then
xrandr --output eDP-1 --off --output DP-1 --mode 3840x2160 --panning 5760x3240+0+0 --scale 1.5x1.5
else
xrandr --output eDP-1 --auto --output DP-1 --off
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment