Big move about + cleanup
This commit is contained in:
14
bin/xorg/activate-default
Executable file
14
bin/xorg/activate-default
Executable 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
2
bin/xorg/altaria/common
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/zsh
|
||||
source $HOME/.config/wryn/env.zsh
|
12
bin/xorg/altaria/hdmi4k
Executable file
12
bin/xorg/altaria/hdmi4k
Executable 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
|
39
bin/xorg/butterfree/common
Normal file
39
bin/xorg/butterfree/common
Normal 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
15
bin/xorg/butterfree/gamedock
Executable 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
15
bin/xorg/butterfree/hdmidock
Executable 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
15
bin/xorg/butterfree/undock
Executable 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"
|
Reference in New Issue
Block a user