dotwryn/config/xserver/set_randr_layout

31 lines
619 B
Plaintext
Raw Normal View History

#!/bin/zsh
2020-01-08 20:38:40 +00:00
source $HOME/.wryn/env/env.zsh
2019-09-26 16:13:45 +00:00
XSERVER_DIR="$DOTWRYN/config/xserver"
2020-01-23 23:08:28 +00:00
2019-12-31 21:26:32 +00:00
AT_HOME(){
2020-01-23 23:08:28 +00:00
xrandr -q | grep -q 'HDMI-0 connected' && xrandr -q | grep -q '3840';
}
CONNECTED_TO_MONITOR() {
2019-12-31 21:26:32 +00:00
xrandr -q | grep -q 'HDMI-0 connected';
}
2019-12-31 21:26:32 +00:00
AT_RENT() {
xrandr -q | grep -q 'DP-[0134] connected';
}
2019-12-31 21:26:32 +00:00
if AT_HOME; then
"$XSERVER_DIR/screenlayout/homedock_hdmionly.sh";
2020-01-23 23:08:28 +00:00
elif CONNECTED_TO_MONITOR; then
if AT_RENT; then
"$XSERVER_DIR/screenlayout/workplus.sh";
else
"$XSERVER_DIR/screenlayout/hdmidock.sh";
fi
2019-12-31 21:26:32 +00:00
elif AT_RENT; then
"$XSERVER_DIR/screenlayout/workdock.sh";
else;
"$XSERVER_DIR/screenlayout/undock.sh";
fi