the GREAT CONFIG MIGRATION; (scwrypts v5 and some neat new config stuffs)

This commit is contained in:
2025-02-19 21:56:37 -07:00
parent 623828461e
commit 1b70e44700
114 changed files with 330 additions and 328 deletions

View File

@@ -0,0 +1 @@
undock

View File

@@ -0,0 +1,19 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
[ ! $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"
xset dpms 0 0 0 && xset s noblank && xset s off \
&& notify-send 'DPMS' 'disabled screen blank'

View File

@@ -0,0 +1,18 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
[ ! $EXTERNAL_MONITOR ] && {
NOTIFY 'No external monitor connected!'
return
}
xrandr \
--output $EXTERNAL_MONITOR \
--primary \
--mode 1920x1080 \
--rotate normal \
--pos 0x0 \
&& DISCONNECT_OTHER login \
|| NOTIFY "Unable to connect '$EXTERNAL_MONITOR' to 1920x1080"
xset dpms 0 0 0 && xset s noblank && xset s off \
&& notify-send 'DPMS' 'disabled screen blank'

View File

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

View File

@@ -0,0 +1,10 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
xrandr \
--output eDP1 \
--primary \
--mode 1280x720 \
--rotate normal \
--pos 0x0 \
&& DISCONNECT_OTHER login \
|| NOTIFY "Unable to connect to do the thing :S"

View File

@@ -0,0 +1,18 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
[ ! $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"
xset +dpms && xset s blank && xset s on \
&& notify-send 'DPMS' 'enabled screen blank'

View File

@@ -0,0 +1,24 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
LEFT=$(GET_ALL_EXTERNAL_MONITORS | grep 'DP.-1')
RIGHT=$(GET_ALL_EXTERNAL_MONITORS | grep 'DP.-2')
[ $LEFT ] && [ $RIGHT ] || {
NOTIFY "Unable to detect work monitors; are you connected?"
return
}
xrandr \
--output $RIGHT \
--primary \
--mode 1920x1080 \
--scale 1.25x1.25 \
--rotate normal \
--pos 2400x0 \
--output $LEFT \
--mode 1920x1080 \
--scale 1.25x1.25 \
--rotate normal \
--pos 0x0 \
&& DISCONNECT_OTHER login $LEFT \
|| NOTIFY "Unable to connect '$EXTERNAL_MONITOR' to 1920x1080"

View File

@@ -0,0 +1,55 @@
#!/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_ALL_EXTERNAL_MONITORS() {
xrandr \
| grep ' connect' \
| awk '{print $1;}' \
| grep -v "${NATIVE_MONITOR}" \
2>/dev/null
}
GET_DEFAULT_EXTERNAL_MONITOR() {
GET_ALL_EXTERNAL_MONITORS | head -n 1
}
EXTERNAL_MONITOR=$(GET_DEFAULT_EXTERNAL_MONITOR)
DISCONNECT_OTHER() {
local SFX="$1"
local INACTIVE_MONITORS=$(\
xrandr --listmonitors \
| sed '1d' | awk '{print $NF;}' \
| grep -v "^$(GET_PRIMARY_MONITOR)$"
)
for ACTIVE_MONITOR in ${@:2}
do
INACTIVE_MONITORS=$(echo ${INACTIVE_MONITORS} | grep -v "^${ACTIVE_MONITOR}$")
done
local MONITOR
for MONITOR in ${INACTIVE_MONITORS}
do
xrandr --output ${MONITOR} --off
done
sleep 1
${DOTWRYN}/bin/set-background random
[ ${SFX} ] && ( scwrypts play sfx -- ${SFX} ) &
return 0
}
NOTIFY() {
notify-send 'xrandr screenlayout' $@
}