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,12 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
xrandr --output $XRANDR_OUTPUT__smol --off
XRANDR_SET \
--compositing disable \
--screen-blank disable \
--background link-vs-gdizz.jpg \
--sound-effect gamedock \
${XRANDR_ARGS__livingroom__1080p[@]} --pos 0x0 --primary \
;

View File

@@ -0,0 +1,12 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
xrandr --output $XRANDR_OUTPUT__smol --off
XRANDR_SET \
--compositing disable \
--screen-blank disable \
--background vegeta.jpg \
--sound-effect gamedock \
${XRANDR_ARGS__livingroom__4k[@]} --pos 0x0 --primary --rate 119.88 \
;

12
config/local/altaria/bin/apps Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/zsh
tmux new -d -s apps -n 'foreman' 'htop' \; \
split-window -d -t apps:foreman "clear; echo 'Keeping apps fresh...'; while true; do sleep 30; done" \
2>/dev/null
for APP in $(find "${0:a:h}" -name apps.\*)
do
echo "looking for $APP"
tmux list-windows -t apps: | awk '{print $2;}' | grep -q $APP \
|| tmux new-window -dn $APP -t apps: "${0:a:h}/$APP"
done

View File

@@ -0,0 +1,8 @@
#!/bin/zsh
cd $HOME/Projects/python/xorg-midi/code
source ../env/bin/activate
./midi-controller
deactivate

View File

@@ -0,0 +1,12 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
xrandr --output $XRANDR_OUTPUT__smol --off
XRANDR_SET \
--compositing disable \
--screen-blank disable \
--background roy-art.jpg \
--sound-effect gamedock \
${XRANDR_ARGS__livingroom__1440p[@]} --pos 0x0 --primary \
;

View File

@@ -0,0 +1,21 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
case $MONITOR_CONFIGURATION in
home )
XRANDR_SET \
--screen-blank disable \
${XRANDR_ARGS__smol__1440p[@]} --pos 0x0 --primary --rate 120.00 \
${XRANDR_ARGS__livingroom__1440p[@]} --pos 0x0 \
;
;;
unknown )
echo 'unknown state; using default configuration to prevent monitor issues'
xrandr --output $(xrandr | grep ' connected' | awk '{print $1;}') --primary
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg
$DOTWRYN/bin/polybar
scwrypts desktop play sfx -- login
return 0
;;
esac

View File

@@ -0,0 +1,12 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
xrandr --output $XRANDR_OUTPUT__livingroom --off
XRANDR_SET \
--compositing enable \
--screen-blank disable \
--sound-effect gamedock \
${XRANDR_ARGS__smol__1440p[@]} --pos 0x0 --rate 180.00 --primary \
;

View File

@@ -0,0 +1,84 @@
#!/bin/zsh
source $HOME/.config/wryn/env.zsh
export DISPLAY=:0
#####################################################################
XRANDR_RESOLUTION__4k='3840x2160'
XRANDR_RESOLUTION__1440p='2560x1440'
XRANDR_RESOLUTION__1080p='1920x1080'
XRANDR_OUTPUT__livingroom='HDMI-0'
XRANDR_OUTPUT__smol='DP-4'
XRANDR_ARGS__livingroom__4k=(--output $XRANDR_OUTPUT__livingroom --mode $XRANDR_RESOLUTION__4k --rate 119.88)
XRANDR_ARGS__livingroom__1440p=(--output $XRANDR_OUTPUT__livingroom --mode $XRANDR_RESOLUTION__1440p)
XRANDR_ARGS__livingroom__1080p=(--output $XRANDR_OUTPUT__livingroom --mode $XRANDR_RESOLUTION__1080p --rate 119.88)
XRANDR_ARGS__smol__1440p=(--output $XRANDR_OUTPUT__smol --mode $XRANDR_RESOLUTION__1440p)
XRANDR_ARGS__smol__1080p=(--output $XRANDR_OUTPUT__smol --mode $XRANDR_RESOLUTION__1080p)
#####################################################################
MONITOR_CONFIGURATION=unknown
: \
&& xrandr --query | grep -q "^$XRANDR_OUTPUT__livingroom connected" \
&& xrandr --query | grep -q "^$XRANDR_OUTPUT__smol connected" \
&& MONITOR_CONFIGURATION=home \
;
###############################################################################
XRANDR_SET() {
local ERRORS=0
local COMPOSITING=enable
local SCREEN_BLANK=enable
local BACKGROUND=$(scwrypts -n get theme).jpg
local SOUND_EFFECT=login
local XRANDR_ARGS=()
while [[ $# -gt 0 ]]
do
case $1 in
--compositing ) COMPOSITING="$2" ; shift 1 ;;
--screen-blank ) SCREEN_BLANK="$2" ; shift 1 ;;
--background ) BACKGROUND="$2" ; shift 1 ;;
--sound-effect ) SOUND_EFFECT="$2" ; shift 1 ;;
* ) XRANDR_ARGS+=($1) ;
esac
shift 1
done
case $COMPOSITING in
enable ) (pkill compton; sleep 1; compton;) & ;;
disable ) pkill compton ;;
* )
echo "ERROR : invalid setting '$COMPOSITING' for compositing" >&2
return 1
esac
case $SCREEN_BLANK in
enable | disable ) ;;
* )
echo "ERROR : invalid setting '$SCREEN_BLANK' for screen blank" >&2
return 1
esac
##########################################
# disabling for a moment since the latest X11/NVIDIA drivers are causing some issues after "disconnect all"
#scwrypts desktop xrandr disconnect all
xrandr ${XRANDR_ARGS[@]}
sleep 1
scwrypts desktop screen blank -- $SCREEN_BLANK
scwrypts desktop i3 set background -- $BACKGROUND || scwrypts desktop i3 set background -- purple.jpg
$DOTWRYN/bin/polybar
scwrypts desktop play sfx -- $SOUND_EFFECT
}

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' $@
}

13
config/local/pikachu/bin/apps Executable file
View File

@@ -0,0 +1,13 @@
#!/bin/zsh
tmux new -d -s apps -n 'foreman' 'htop' \; \
split-window -d -t apps:foreman "clear; echo 'Keeping apps fresh...'; while true; do sleep 30; done" \
2>/dev/null
${XDG_DATA_HOME}/home/w0ryn/.local/share/project-source-code/yage/dotwryn/code/config/local/pikachu/bin
for APP in $(find "${0:a:h}" -name apps.\*)
do
echo "looking for $APP"
tmux list-windows -t apps: | awk '{print $2;}' | grep -q $APP \
|| tmux new-window -dn $APP -t apps: "${0:a:h}/$APP"
done

View File

@@ -0,0 +1,13 @@
#!/bin/zsh
cd ${XDG_DATA_HOME:-${HOME}/.local/share}/project-source-code/python/xorg-midi/code
source ../env/bin/activate
while true
do
clear
echo "activating midi controller"
./midi-controller
echo "midi controller died; waiting to reconnect"
sleep 3
done

View File

@@ -0,0 +1,6 @@
#!/bin/zsh
xrandr --auto
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg
scwrypts desktop screen blank -- enable

View File

@@ -0,0 +1,10 @@
#!/bin/zsh
xrandr --auto
xrandr --output HDMI-1-0 --off
sleep 1
xrandr --output HDMI-1-0 --mode 2560x1440
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg
scwrypts desktop screen blank -- disable

11
config/local/pikachu/bin/office Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/zsh
xrandr --auto
xrandr --output HDMI-1-0 --off
sleep 1
xrandr --output HDMI-1-0 --mode 1920x1080
xrandr --output eDP-1 --off
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg
scwrypts desktop screen blank -- disable

View File

@@ -0,0 +1 @@
/home/w0ryn/.local/share/wryn/zsh/plugins/scwrypts/scwrypts

View File

@@ -0,0 +1,18 @@
#!/bin/bash
[[ $EUID -eq 0 ]] || {
echo "root access required" >&2
exit 1
}
MAX_CHARGE_THRESHOLD=$1
[ "$MAX_CHARGE_THRESHOLD" ] \
|| MAX_CHARGE_THRESHOLD=75
DEVICE_SETTING_FILE=/sys/class/power_supply/BAT1/charge_control_end_threshold
[ "$MAX_CHARGE_THRESHOLD" ] && [[ $MAX_CHARGE_THRESHOLD -ge 40 ]] && [[ $MAX_CHARGE_THRESHOLD -le 100 ]] || {
echo -e "Value '$MAX_CHARGE_THRESHOLD' is invalid. If you REALLY want to do this, overwrite the setting yourself\n$DEVICE_SETTING_FILE" >&2
exit 2
}
echo "$MAX_CHARGE_THRESHOLD" > "$DEVICE_SETTING_FILE"

View File

@@ -0,0 +1,7 @@
#!/bin/zsh
xrandr --output HDMI-1-0 --off
xrandr --output eDP-1 --mode 2560x1600
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg
scwrypts desktop screen blank -- disable

View File

@@ -0,0 +1,40 @@
Section "Files"
ModulePath "/usr/lib/nvidia"
ModulePath "/usr/lib32/nvidia"
ModulePath "/usr/lib32/nvidia/xorg/modules"
ModulePath "/usr/lib32/xorg/modules"
ModulePath "/usr/lib64/nvidia/xorg/modules"
ModulePath "/usr/lib64/nvidia/xorg"
ModulePath "/usr/lib64/xorg/modules"
EndSection
Section "ServerLayout"
Identifier "layout"
Screen 0 "integrated"
Inactive "nvidia"
Option "AllowNVIDIAGPUScreens"
EndSection
Section "Device"
Identifier "integrated"
Driver "modesetting"
BusID "PCI:101:0:0"
Option "DRI" "3"
EndSection
Section "Screen"
Identifier "integrated"
Device "integrated"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:100:0:0"
Option "Coolbits" "28"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
EndSection

View File

@@ -0,0 +1,40 @@
Section "Files"
ModulePath "/usr/lib/nvidia"
ModulePath "/usr/lib32/nvidia"
ModulePath "/usr/lib32/nvidia/xorg/modules"
ModulePath "/usr/lib32/xorg/modules"
ModulePath "/usr/lib64/nvidia/xorg/modules"
ModulePath "/usr/lib64/nvidia/xorg"
ModulePath "/usr/lib64/xorg/modules"
EndSection
Section "ServerLayout"
Identifier "layout"
Screen 0 "integrated"
Inactive "nvidia"
Option "AllowNVIDIAGPUScreens"
EndSection
Section "Device"
Identifier "integrated"
Driver "modesetting"
BusID "PCI:101:0:0"
Option "DRI" "3"
EndSection
Section "Screen"
Identifier "integrated"
Device "integrated"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:100:0:0"
Option "Coolbits" "28"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
EndSection

View File

@@ -0,0 +1 @@
ACTION=="add", RUN+="/home/w0ryn/.local/share/wryn/config/local/pikachu/bin/set-battery-max-charge"

View File

@@ -0,0 +1 @@
SUBSYSTEM=="backlight", ACTION=="add", RUN+="/usr/bin/env chgrp video %S%p/brightness", RUN+="/usr/bin/env chmod g+w %S%p/brightness"

View File

@@ -0,0 +1,20 @@
--- a/analog-output-speaker.conf
+++ b/analog-output-speaker.conf
@@ -71,12 +71,14 @@
[Element Hardware Master]
switch = mute
-volume = merge
-override-map.1 = all
-override-map.2 = all-left,all-right
+volume = ignore
[Element Master]
switch = mute
+volume = ignore
+
+[Element PCM]
+switch = mute
volume = merge
override-map.1 = all
override-map.2 = all-left,all-right

View File

@@ -0,0 +1,2 @@
#!/bin/zsh
sudo patch -p1 -d /usr/share/alsa-card-profile/mixer/paths/ -i "${0:a:h}/pulseaudio.patch"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
[font]
size = 9

View File

@@ -0,0 +1 @@
undock

View File

@@ -0,0 +1,17 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
ARGS=($(ALL_OTHER_DISPLAYS_OFF eDP-1))
xrandr ${ARGS[@]} \
--output eDP-1 \
--primary \
--mode 960x600 \
--pos 0x0 \
--rotate normal \
;
pkill compton
scwrypts desktop screen-blank -- disable
scwrypts desktop i3 set background -- link-vs-gdizz.jpg
scwrypts desktop play sfx -- gamedock

View File

@@ -0,0 +1 @@
../../zsh/plugins/scwrypts/scwrypts

17
config/local/umbreon/bin/undock Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/zsh
source ${0:a:h}/xorg.zsh
ARGS=($(ALL_OTHER_DISPLAYS_OFF eDP-1))
xrandr ${ARGS[@]} \
--output eDP-1 \
--primary \
--mode 1920x1200 \
--pos 0x0 \
--rotate normal \
;
(pkill compton; sleep 0.5; compton;) &
scwrypts desktop screen-blank -- enable
scwrypts desktop i3 set background -- $(scwrypts -n get theme).jpg || scwrypts desktop i3 set background -- random
scwrypts desktop play sfx -- gamedock

View File

@@ -0,0 +1,10 @@
#!/bin/zsh
source $HOME/.config/wryn/env.zsh
[ ! $DISPLAY ] && export DISPLAY=:0
ALL_OTHER_DISPLAYS_OFF() {
for OUTPUT in $(xrandr | grep connect | grep -v $1 | awk '{print $1;}')
do
echo --output $OUTPUT --off
done
}