2020-09-22 04:52:58 +00:00
|
|
|
#!/bin/sh
|
2021-09-15 07:48:37 +00:00
|
|
|
source "$HOME/.config/wryn/env/env.zsh"
|
2021-02-25 01:15:23 +00:00
|
|
|
|
2020-09-22 04:52:58 +00:00
|
|
|
NATIVE_MONITOR='eDP1';
|
2020-09-17 22:26:20 +00:00
|
|
|
CONNECTED_MONITOR=$(xrandr | grep ' connect' | awk '{print $1;}' | grep -v "$NATIVE_MONITOR" | head -n 1);
|
|
|
|
|
|
|
|
MONITOR_DIRECTION='--above'; # left-of, below, above, right-of
|
|
|
|
|
|
|
|
[ -z $CONNECTED_MONITOR ] && return; # no external monitor connected; do nothing
|
|
|
|
[ $1 ] && MONITOR_DIRECTION="$1";
|
|
|
|
|
|
|
|
xrandr\
|
|
|
|
--output "$NATIVE_MONITOR" --primary\
|
|
|
|
--rotate normal\
|
|
|
|
--pos 0x0\
|
|
|
|
--mode $(xrandr | grep -A 2 "$NATIVE_MONITOR" | sed -n '2 p' | awk '{print $1;}')\
|
|
|
|
;
|
|
|
|
|
2020-09-18 04:12:05 +00:00
|
|
|
sleep 0.5
|
|
|
|
|
2020-09-17 22:26:20 +00:00
|
|
|
xrandr\
|
|
|
|
--output "$CONNECTED_MONITOR"\
|
|
|
|
--rotate normal\
|
|
|
|
$MONITOR_DIRECTION $NATIVE_MONITOR\
|
2020-09-18 04:12:05 +00:00
|
|
|
--mode $(xrandr | grep -A 2 "^$CONNECTED_MONITOR" | sed -n '2 p' | awk '{print $1;}')\
|
2020-09-17 22:26:20 +00:00
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
for display in $(xrandr | grep connect | awk '{print $1;}' | grep -v "$NATIVE_MONITOR" | grep -v "$CONNECTED_MONITOR"); do
|
|
|
|
xrandr --output $display --off;
|
|
|
|
done;
|
|
|
|
|
2021-02-25 01:15:23 +00:00
|
|
|
"$DOTWRYN/bin/desktop/feh/randomize-background.sh"
|
2020-11-17 22:11:42 +00:00
|
|
|
[ -f $HOME/.config/wryn/sfx ] && $HOME/.config/wryn/sfx login
|