Added mobile monitor setup scripts

This commit is contained in:
Wryn Wagner 2020-01-23 16:08:28 -07:00
parent fe57223828
commit e1a7870d5d
3 changed files with 42 additions and 0 deletions

View File

@ -1,4 +1,5 @@
#!/bin/sh #!/bin/sh
xrandr --output DP-0 --off\ xrandr --output DP-0 --off\
--output DP-1 --off\ --output DP-1 --off\
--output DP-3 --off\ --output DP-3 --off\
@ -6,6 +7,14 @@ xrandr --output DP-0 --off\
--output DP-2 --primary --mode 2880x1800 --scale 0.8x0.8 --pos 0x0 --rotate normal\ --output DP-2 --primary --mode 2880x1800 --scale 0.8x0.8 --pos 0x0 --rotate normal\
--output HDMI-0 --pos 2880x0 --rotate normal --output HDMI-0 --pos 2880x0 --rotate normal
#xrandr | grep -q "3840" >/dev/null 2>&1;
#if [[ $? -ne 0 ]]; then
# if xrandr | grep -q "1920"; then
# xrandr --output HDMI-0 --mode 1920x1080 --pos 2880x0 --rotate normal --scale 1.5x1.5;
# fi
#fi
ROLL=$(($RANDOM%4)); ROLL=$(($RANDOM%4));
if [ $ROLL -eq 0 ]; then if [ $ROLL -eq 0 ]; then

View File

@ -0,0 +1,22 @@
#!/bin/sh
if xrandr | grep -q "DP-0 connected"; then
xrandr \
--output DP-0 --mode 1920x1080 --pos 0x0 --rotate normal --scale 1.5x1.5 --primary\
--output DP-1 --off\
--output DP-2 --mode 2880x1800 --pos 5760x0 --rotate normal --scale 0.8x0.8\
--output DP-3 --off\
--output DP-4 --mode 1920x1080 --pos 2880x0 --rotate normal --scale 1.5x1.5\
--output HDMI-0 --mode 1920x1080 --pos 8640x0 --rotate left\
;
else
xrandr \
--output DP-0 --off\
--output DP-1 --mode 1920x1080 --pos 0x0 --rotate normal --scale 1.5x1.5 --primary\
--output DP-2 --mode 2880x1800 --pos 5760x0 --rotate normal --scale 0.8x0.8\
--output DP-3 --mode 1920x1080 --pos 2880x0 --rotate normal --scale 1.5x1.5\
--output DP-4 --off\
--output HDMI-0 --mode 1920x1080 --pos 8640x0 --rotate left\
;
fi
feh --bg-fill --randomize $HOME/Pictures/bg >/dev/null 2>&1;

View File

@ -2,7 +2,12 @@
source $HOME/.wryn/env/env.zsh source $HOME/.wryn/env/env.zsh
XSERVER_DIR="$DOTWRYN/config/xserver" XSERVER_DIR="$DOTWRYN/config/xserver"
AT_HOME(){ AT_HOME(){
xrandr -q | grep -q 'HDMI-0 connected' && xrandr -q | grep -q '3840';
}
CONNECTED_TO_MONITOR() {
xrandr -q | grep -q 'HDMI-0 connected'; xrandr -q | grep -q 'HDMI-0 connected';
} }
@ -12,6 +17,12 @@ AT_RENT() {
if AT_HOME; then if AT_HOME; then
"$XSERVER_DIR/screenlayout/homedock_hdmionly.sh"; "$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 elif AT_RENT; then
"$XSERVER_DIR/screenlayout/workdock.sh"; "$XSERVER_DIR/screenlayout/workdock.sh";
else; else;