dotwryn/config/xserver/set_randr_layout
2020-01-23 16:08:28 -07:00

31 lines
619 B
Bash
Executable File

#!/bin/zsh
source $HOME/.wryn/env/env.zsh
XSERVER_DIR="$DOTWRYN/config/xserver"
AT_HOME(){
xrandr -q | grep -q 'HDMI-0 connected' && xrandr -q | grep -q '3840';
}
CONNECTED_TO_MONITOR() {
xrandr -q | grep -q 'HDMI-0 connected';
}
AT_RENT() {
xrandr -q | grep -q 'DP-[0134] connected';
}
if AT_HOME; then
"$XSERVER_DIR/screenlayout/homedock_hdmionly.sh";
elif CONNECTED_TO_MONITOR; then
if AT_RENT; then
"$XSERVER_DIR/screenlayout/workplus.sh";
else
"$XSERVER_DIR/screenlayout/hdmidock.sh";
fi
elif AT_RENT; then
"$XSERVER_DIR/screenlayout/workdock.sh";
else;
"$XSERVER_DIR/screenlayout/undock.sh";
fi