dotfiles/system/.local/bin/resolution
Severin Kaderli 49b5ad585a
All checks were successful
continuous-integration/drone/push Build is passing
Update resolution script
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
2020-08-23 20:49:19 +02:00

45 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# SCRIPT NAME:
# resolution
#
# AUTHOR:
# Severin Kaderli <severin@kaderli.dev>
#
# DESCRIPTION:
# This is the script that is used to setup my monitors. This script
# is used by i3.
#
# USAGE:
# ./resolution
xrandr --listproviders | grep -q "modesetting" && xrandr --setprovideroutputsource 1 0
xrandr --dpi 96
if is-connected "HDMI1"; then
xrandr --output HDMI1 --primary --mode 1920x1200 --left-of eDP1
else
xrandr --output HDMI1 --off > /dev/null 2>&1
fi
if is-connected "HDMI-1-1"; then
xrandr --output HDMI-1-1 --primary --mode 1920x1200 --left-of eDP-1-1
else
xrandr --output HDMI-1-1 --off > /dev/null 2>&1
fi
xrandr --output eDP1 --mode 1920x1080 --pos 1920x0 --rotate normal
xrandr --output eDP-1-1 --mode 1920x1080 --pos 1920x0 --rotate normal
if is-connected "DVI-I-1-1"; then
xrandr --output DVI-I-1-1 --mode 1920x1080 --left-of eDP1
else
xrandr --output DVI-I-1-1 --off > /dev/null 2>&1
fi
if is-connected "DVI-I-2-1"; then
xrandr --output DVI-I-2-1 --mode 1920x1080 --left-of eDP-1-1
else
xrandr --output DVI-I-2-1 --off > /dev/null 2>&1
fi