Big move about + cleanup

This commit is contained in:
yage
2022-02-06 00:15:14 -07:00
parent 220fa678c5
commit a7bf48df9e
134 changed files with 682 additions and 3185 deletions

14
bin/xorg/activate-default Executable file
View File

@ -0,0 +1,14 @@
#!/bin/zsh
_HOSTNAME=$(hostnamectl --static)
case $_HOSTNAME in
butterfree ) DEFAULT=undock ;;
altaria ) DEFAULT=hdmi4k ;;
esac
LAYOUT="${0:a:h}/$_HOSTNAME/$DEFAULT"
[ -f $LAYOUT ] && {
until xrandr -q >/dev/null 2>&1; do sleep .1; done
$LAYOUT
}

2
bin/xorg/altaria/common Normal file
View File

@ -0,0 +1,2 @@
#!/bin/zsh
source $HOME/.config/wryn/env.zsh

12
bin/xorg/altaria/hdmi4k Executable file
View File

@ -0,0 +1,12 @@
#!/bin/zsh
source ${0:a:h}/common
xrandr \
--output HDMI-0 \
--primary \
--mode 3840x2160 \
--rotate normal \
--pos 0x0 \
;
PLAY_SFX login

View File

@ -0,0 +1,39 @@
#!/bin/zsh
source "$HOME/.config/wryn/env.zsh"
NATIVE_MONITOR='eDP1'
GET_PRIMARY_MONITOR() {
xrandr \
| grep 'primary' \
| awk '{print $1;}' \
| head -n 1
}
PRIMARY_MONITOR=$(GET_PRIMARY_MONITOR)
GET_DEFAULT_EXTERNAL_MONITOR() {
xrandr \
| grep ' connect' \
| awk '{print $1;}' \
| grep -v "$NATIVE_MONITOR" \
| head -n 1
}
EXTERNAL_MONITOR=$(GET_DEFAULT_EXTERNAL_MONITOR)
DISCONNECT_OTHER() {
local SFX="$1"
for D in $(xrandr | awk '{print $1;}' | grep -v $(GET_PRIMARY_MONITOR))
do
xrandr --output $D --off
done
$DOTWRYN/bin/randomize-background
[ $SFX ] && ( PLAY_SFX $SFX ) &
return 0
}
NOTIFY() {
notify-send 'xrandr screenlayout' $@
}

15
bin/xorg/butterfree/gamedock Executable file
View File

@ -0,0 +1,15 @@
#!/bin/zsh
source ${0:a:h}/common
[ ! $PRIMARY_MONITOR ] && {
NOTIFY 'Unable to detect primary monitor'
return
}
xrandr \
--output $PRIMARY_MONITOR \
--primary \
--mode 1920x1080 \
--rotate normal \
--pos 0x0 \
&& DISCONNECT_OTHER gamedock \
|| NOTIFY "Unable to set '$PRIMARY_MONITOR' to 1920x1080"

15
bin/xorg/butterfree/hdmidock Executable file
View File

@ -0,0 +1,15 @@
#!/bin/zsh
source ${0:a:h}/common
[ ! $EXTERNAL_MONITOR ] && {
NOTIFY 'No external monitor connected!'
return
}
xrandr \
--output $EXTERNAL_MONITOR \
--primary \
--auto \
--rotate normal \
--pos 0x0 \
&& DISCONNECT_OTHER login \
|| NOTIFY "Unable to connect '$EXTERNAL_MONITOR' to 1920x1080"

15
bin/xorg/butterfree/undock Executable file
View File

@ -0,0 +1,15 @@
#!/bin/zsh
source ${0:a:h}/common
[ ! $NATIVE_MONITOR ] && {
NOTIFY "Must specify NATIVE_MONITOR"
return
}
xrandr \
--output $NATIVE_MONITOR \
--primary \
--mode "2560x1440" \
--rotate normal \
--pos 0x0 \
&& DISCONNECT_OTHER undock \
|| NOTIFY "Native monitor '$PRIMARY_MONITOR' unresponsive"