2019-12-31 06:44:40 +00:00
|
|
|
#!/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"
|
|
|
|
|
2019-12-31 21:26:32 +00:00
|
|
|
AT_HOME(){
|
2020-09-18 04:12:05 +00:00
|
|
|
xrandr -q | grep -q 'DP2-1 connected' && xrandr -q | grep -q '3840';
|
2020-01-23 23:08:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
CONNECTED_TO_MONITOR() {
|
2020-09-18 04:12:05 +00:00
|
|
|
xrandr -q | grep ' connected' | grep -v 'eDP1' -q;
|
2019-12-31 21:26:32 +00:00
|
|
|
}
|
2019-12-31 06:44:40 +00:00
|
|
|
|
2019-12-31 21:26:32 +00:00
|
|
|
if AT_HOME; then
|
2020-09-18 04:12:05 +00:00
|
|
|
"$XSERVER_DIR/screenlayout/homedock.sh";
|
2020-01-23 23:08:28 +00:00
|
|
|
elif CONNECTED_TO_MONITOR; then
|
2020-09-18 04:12:05 +00:00
|
|
|
"$XSERVER_DIR/screenlayout/hdmidock.sh" '--right-of';
|
2019-12-31 06:44:40 +00:00
|
|
|
else;
|
|
|
|
"$XSERVER_DIR/screenlayout/undock.sh";
|
|
|
|
fi
|