version 3 refactor

This commit is contained in:
Wryn Wagner
2021-02-24 17:38:02 -07:00
parent 35fc078b0e
commit 67e9710ab0
29 changed files with 187 additions and 180 deletions

View File

@ -0,0 +1,40 @@
#!/bin/sh
xrandr --output DP-0 --off\
--output DP-1 --off\
--output DP-3 --off\
--output DP-4 --off\
--output DP-2 --primary --mode 2880x1800 --scale 0.8x0.8 --pos 0x0 --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));
if [ $ROLL -eq 0 ]; then
feh --bg-fill\
$HOME/Pictures/bg/midoriya.jpg\
$HOME/Pictures/bg/vegeta.jpg\
>/dev/null 2>&1
elif [ $ROLL -eq 1 ]; then
feh --bg-fill\
$HOME/Pictures/bg/ike_vs_bk.jpg\
$HOME/Pictures/bg/seiros_vs_nemesis.jpg\
>/dev/null 2>&1
elif [ $ROLL -eq 2 ]; then
feh --bg-fill\
$HOME/Pictures/bg/captainfalcon.jpg\
$HOME/Pictures/bg/link.jpg\
>/dev/null 2>&1
elif [ $ROLL -eq 3 ]; then
feh --bg-fill\
$HOME/Pictures/bg/fe8.jpg\
$HOME/Pictures/bg/micaiah.jpg\
>/dev/null 2>&1
fi

View File

@ -0,0 +1,18 @@
#!/bin/sh
xrandr --output DP-0 --off\
--output DP-1 --off\
--output DP-2 --off\
--output DP-3 --off\
--output DP-4 --off\
--output HDMI-0 --primary --mode 1920x1080 --pos 2880x0 --rotate normal
ROLL=$(($RANDOM%3));
if [ $ROLL -eq 0 ]; then
feh --bg-fill $HOME/Pictures/bg/detective.jpg >/dev/null 2>&1
elif [ $ROLL -eq 1 ]; then
feh --bg-fill $HOME/Pictures/bg/link.png >/dev/null 2>&1
elif [ $ROLL -eq 2 ]; then
feh --bg-fill $HOME/Pictures/bg/snow2.jpg >/dev/null 2>&1
fi

View File

@ -0,0 +1,18 @@
#!/bin/sh
xrandr --output DP-0 --off\
--output DP-1 --off\
--output DP-2 --off\
--output DP-3 --off\
--output DP-4 --off\
--output HDMI-0 --primary --mode 3840x2160 --pos 2880x0 --rotate normal
ROLL=$(($RANDOM%3));
if [ $ROLL -eq 0 ]; then
feh --bg-fill $HOME/Pictures/bg/detective.jpg >/dev/null 2>&1
elif [ $ROLL -eq 1 ]; then
feh --bg-fill $HOME/Pictures/bg/link.png >/dev/null 2>&1
elif [ $ROLL -eq 2 ]; then
feh --bg-fill $HOME/Pictures/bg/snow2.jpg >/dev/null 2>&1
fi

View File

@ -0,0 +1,31 @@
#!/bin/sh
xrandr --output DP-0 --off\
--output DP-1 --off\
--output HDMI-0 --off\
--output DP-3 --off\
--output DP-4 --off\
--output DP-2 --primary --mode 2880x1800 --scale 0.8x0.8 --pos 0x0 --rotate normal
ROLL=$(($RANDOM%10));
if [ $ROLL -eq 0 ]; then
feh --bg-fill $HOME/Pictures/bg/vegeta.jpg >/dev/null 2>&1
elif [ $ROLL -eq 1 ]; then
feh --bg-fill $HOME/Pictures/bg/claude.jpg >/dev/null 2>&1
elif [ $ROLL -eq 2 ]; then
feh --bg-fill $HOME/Pictures/bg/ike_vs_bk.jpg >/dev/null 2>&1
elif [ $ROLL -eq 3 ]; then
feh --bg-fill $HOME/Pictures/bg/snow1.jpg >/dev/null 2>&1
elif [ $ROLL -eq 4 ]; then
feh --bg-fill $HOME/Pictures/bg/midoriya.jpg >/dev/null 2>&1
elif [ $ROLL -eq 5 ]; then
feh --bg-fill $HOME/Pictures/bg/pikachu.jpg >/dev/null 2>&1
elif [ $ROLL -eq 6 ]; then
feh --bg-fill $HOME/Pictures/bg/captainfalcon.jpg >/dev/null 2>&1
elif [ $ROLL -eq 7 ]; then
feh --bg-fill $HOME/Pictures/bg/seiros_vs_nemesis.jpg >/dev/null 2>&1
elif [ $ROLL -eq 8 ]; then
feh --bg-fill $HOME/Pictures/bg/kirito.jpg >/dev/null 2>&1
elif [ $ROLL -eq 9 ]; then
feh --bg-fill $HOME/Pictures/bg/altaria.jpg >/dev/null 2>&1
fi

View File

@ -0,0 +1,54 @@
#!/bin/sh
if xrandr | grep -q "DP-0 connected"; then
xrandr \
--output DP-0 --primary --mode 1920x1080 --pos 0x586 --rotate normal --scale 1.5x1.5\
--output DP-1 --off \
--output HDMI-0 --off \
--output DP-2 --mode 2880x1800 --pos 4500x586 --rotate normal --scale 0.8x0.8\
--output DP-3 --off \
--output DP-4 --mode 1920x1080 --pos 2880x0 --rotate right --scale 1.5x1.5\
;
else
xrandr \
--output DP-0 --off \
--output DP-1 --primary --mode 1920x1080 --pos 0x586 --rotate normal --scale 1.5x1.5\
--output HDMI-0 --off \
--output DP-2 --mode 2880x1800 --pos 4500x586 --rotate normal --scale 0.8x0.8\
--output DP-3 --mode 1920x1080 --pos 2880x0 --rotate right --scale 1.5x1.5\
--output DP-4 --off \
;
fi
ROLL=$(($RANDOM%5));
if [ $ROLL -eq 0 ]; then
feh --bg-fill\
$HOME/Pictures/bg/midoriya.jpg\
$HOME/Pictures/bg/altaria.jpg\
$HOME/Pictures/bg/captainfalcon.jpg\
>/dev/null 2>&1;
elif [ $ROLL -eq 1 ]; then
feh --bg-fill\
$HOME/Pictures/bg/dimitri.jpg\
$HOME/Pictures/bg/claude.jpg\
$HOME/Pictures/bg/edelgard.jpg\
>/dev/null 2>&1;
elif [ $ROLL -eq 2 ]; then
feh --bg-fill\
$HOME/Pictures/bg/fe8.jpg\
$HOME/Pictures/bg/micaiah.jpg\
$HOME/Pictures/bg/roy.jpg\
>/dev/null 2>&1;
elif [ $ROLL -eq 3 ]; then
feh --bg-fill\
$HOME/Pictures/bg/chrom.png\
$HOME/Pictures/bg/byleth.jpg\
$HOME/Pictures/bg/link.jpg\
>/dev/null 2>&1;
elif [ $ROLL -eq 4 ]; then
random_image="$(find $HOME/Pictures/bg -type f | shuf -n 1)";
feh --bg-fill\
$random_image\
>/dev/null 2>&1;
fi

View File

@ -0,0 +1,45 @@
#!/bin/sh
# Positions
# MONITOR | ORIENTATION | POSITION
# ------------|-------------|----------
# DP-1 / DP-0 | ANY | 0x0
# DP-2 | DP-1/0:NORM | 5760x0
# DP-2 | DP-1/0:LEFT | 3240x0
# DP-3 / DP-4 | NORMAL | 2880x0
# DP-3 / DP-4 | RIGHT | 1620x0
# HDMI-0 | DP-1/0:NORM | 8640x0
# HDMI-0 | DP-1/0:LEFT | 5533x0
if xrandr | grep -q "DP-0 connected"; then
xrandr \
--output DP-0 --mode 1920x1080 --scale 1.5x1.5 --primary\
--pos 0x0 --rotate left\
--output DP-1 --off\
--output DP-2 --mode 2880x1800--rotate normal --scale 0.8x0.8\
--pos 3240x0\
--output DP-3 --off\
--output DP-4 --mode 1920x1080 --scale 1.5x1.5\
--pos 1620x0 --rotate right\
--output HDMI-0 --mode 1920x1080 --rotate left\
--pos 5544x0\
--setmonitor BigBoi auto DP-0,DP-4\
;
else
xrandr \
--output DP-0 --off\
--output DP-1 --mode 1920x1080 --scale 1.5x1.5 --primary\
--pos 0x0 --rotate left\
--output DP-2 --mode 2880x1800 --scale 0.8x0.8\
--pos 3240x0 --rotate normal\
--output DP-3 --mode 1920x1080 --scale 1.5x1.5\
--pos 1620x0 --rotate right\
--output DP-4 --off\
--output HDMI-0 --mode 1920x1080\
--pos 5544x0 --rotate left\
--setmonitor BigBoi auto DP-1,DP-3\
;
fi
feh --bg-fill --randomize $HOME/Pictures/bg >/dev/null 2>&1;

View File

@ -0,0 +1,22 @@
#!/bin/sh
RESOLUTION='1920x1080';
[ $1 ] && RESOLUTION="$1";
CURRENT_MONITOR=$(xrandr | grep 'primary' | awk '{print $1;}' | tail -n 1);
xrandr\
--output "$CURRENT_MONITOR" --primary\
--rotate normal\
--pos 0x0\
--mode $RESOLUTION\
;
for display in $(xrandr | grep connect | awk '{print $1;}' | grep -v "$CURRENT_MONITOR"); do
xrandr --output $display --off;
done;
feh --bg-fill --randomize $HOME/.config/wryn/wallpaper;
[ -f $HOME/.config/wryn/sfx ] && $HOME/.config/wryn/sfx gamedock

View File

@ -0,0 +1,32 @@
#!/bin/sh
NATIVE_MONITOR='eDP1';
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;}')\
;
sleep 0.5
xrandr\
--output "$CONNECTED_MONITOR"\
--rotate normal\
$MONITOR_DIRECTION $NATIVE_MONITOR\
--mode $(xrandr | grep -A 2 "^$CONNECTED_MONITOR" | sed -n '2 p' | awk '{print $1;}')\
;
for display in $(xrandr | grep connect | awk '{print $1;}' | grep -v "$NATIVE_MONITOR" | grep -v "$CONNECTED_MONITOR"); do
xrandr --output $display --off;
done;
feh --recursive --bg-fill --randomize $HOME/.config/wryn/wallpaper;
[ -f $HOME/.config/wryn/sfx ] && $HOME/.config/wryn/sfx login

View File

@ -0,0 +1,20 @@
#!/bin/sh
NATIVE_MONITOR='eDP1';
HOMEDOCK_MONITOR=$(xrandr | grep ' connect' | awk '{print $1;}' | grep -v "$NATIVE_MONITOR" | head -n 1);
[ -z $HOMEDOCK_MONITOR ] && return; # no external monitor connected; do nothing
xrandr\
--output "$HOMEDOCK_MONITOR" --primary\
--rotate normal\
--pos 0x0\
--mode $(xrandr | grep -A 2 "$HOMEDOCK_MONITOR" | sed -n '2 p' | awk '{print $1;}')\
;
for display in $(xrandr | grep connect | awk '{print $1;}' | grep -v "$HOMEDOCK_MONITOR"); do
xrandr --output $display --off;
done;
feh --bg-fill --randomize $HOME/.config/wryn/wallpaper;
[ -f $HOME/.config/wryn/sfx ] && $HOME/.config/wryn/sfx homedock

View File

@ -0,0 +1,20 @@
#!/bin/sh
NATIVE_MONITOR='eDP1';
TV_DISPLAY=$(xrandr | grep ' connect' | awk '{print $1;}' | grep -v "$NATIVE_MONITOR" | head -n 1);
[ -z $TV_DISPLAY ] && return; # no external monitor connected; do nothing
xrandr\
--output "$TV_DISPLAY" --primary\
--rotate normal\
--pos 0x0\
--mode 1920x1080\
;
for display in $(xrandr | grep connect | awk '{print $1;}' | grep -v "$TV_DISPLAY"); do
xrandr --output $display --off;
done;
feh --bg-fill --randomize $HOME/.config/wryn/wallpaper;
[ -f $HOME/.config/wryn/sfx ] && $HOME/.config/wryn/sfx gamedock

View File

@ -0,0 +1,22 @@
#!/bin/sh
NATIVE_MONITOR='eDP1';
NATIVE_MODE="$(xrandr | grep -A 2 "$NATIVE_MONITOR" | sed -n '2 p' | awk '{print $1;}')";
[[ $(xrandr -q | grep ' connected' | wc -l) -eq 1 ]] \
&& xrandr -q | grep "$NATIVE_MONITOR connected" | grep -q '3840' \
&& NATIVE_MODE='2880x1620';
xrandr\
--output "$NATIVE_MONITOR" --primary\
--rotate normal\
--pos 0x0\
--mode "$NATIVE_MODE"\
;
for display in $(xrandr | grep connect | awk '{print $1;}' | grep -v "$NATIVE_MONITOR"); do
xrandr --output $display --off;
done;
feh --bg-fill --randomize $HOME/.config/wryn/wallpaper;
[ -f $HOME/.config/wryn/sfx ] && $HOME/.config/wryn/sfx undock

19
config/xorg/set_randr_layout Executable file
View File

@ -0,0 +1,19 @@
#!/bin/zsh
source "$HOME/.config/wryn/env/env"
XSERVER_DIR="$DOTWRYN/config/xorg"
AT_HOME(){
xrandr -q | grep -q 'DP2-1 connected' && xrandr -q | grep -q '3840';
}
CONNECTED_TO_MONITOR() {
xrandr -q | grep ' connected' | grep -v 'eDP1' -q;
}
if AT_HOME; then
"$XSERVER_DIR/screenlayout/homedock.sh";
elif CONNECTED_TO_MONITOR; then
"$XSERVER_DIR/screenlayout/hdmidock.sh" '--right-of';
else;
"$XSERVER_DIR/screenlayout/undock.sh";
fi

21
config/xorg/xinitrc Normal file
View File

@ -0,0 +1,21 @@
#!/bin/sh
source "$HOME/.config/wryn/env/env"
X11_SCRIPTS='/etc/X11/xinit/xinitrc.d';
if [ -d $X11_SCRIPTS ] ; then
for script in $(find "$X11_SCRIPTS" -name \*.sh); do
source "$script";
done
fi
CUSTOM_DMENU_COMMANDS="$HOME/.local/custom_dmenu"
[ ! -d $CUSTOM_DMENU_COMMANDS ] && mkdir $CUSTOM_DMENU_COMMANDS
export PATH="$CUSTOM_DMENU_COMMANDS:$PATH"
"$DOTWRYN/config/xorg/set_randr_layout" &
exec i3;