feat(xrandr): Update display organiser script

Move to a generic script and load configurations per detected IDs
This commit is contained in:
Tanguy Herbron 2023-09-14 09:57:52 +02:00
parent 6695c738e5
commit 331838de06

View File

@ -1,36 +1,22 @@
#!/bin/sh
export DISPLAY=:0
export XAUTHORITY=/home/tanguy/.Xauthority
export XAUTHORITY=~/.Xauthority
/home/tanguy/.screenlayout/base.sh
# TODO : Configure each dock configuration with MAC addresses
DOCK_ID=$(lsusb -d 0x17ef:0x30a9 -v | grep -i iserial | awk '{print $3}') > /dev/null 2>&1
if [[ "$(ip a | grep 'e0:4f:43:59:98:f4' | wc -l)" == 1 ]]; then
/home/tanguy/.screenlayout/tegl-e0-4f.sh
i3-msg "workspace 1, move workspace to output DVI-I-1-1";
i3-msg "workspace 2, move workspace to output DCI-I-2-2";
i3-msg "workspace 3, move workspace to output eDP-1"
i3-msg "workspace 4, move workspace to output eDP-1"
if [ -z "$DOCK_ID" ]; then
/bin/sh -c ~/.screenlayout/base.sh > /dev/null 2>&1
/bin/sh -c ~/.bin/workspacelayout/base.sh > /dev/null 2>&1
exit 0;
fi
if [[ "$(ip a | grep 'f4:a8:0d:41:e1:aa' | wc -l)" == 1 ]]; then
/home/tanguy/.screenlayout/tegl-e1-aa.sh
FILE=~/.screenlayout/$DOCK_ID.sh
if test -f $FILE; then
~/.screenlayout/$DOCK_ID.sh > /dev/null 2>&1
~/.bin/workspacelayout/$DOCK_ID.sh > /dev/null 2>&1
i3-msg "workspace 1, move workspace to output DP-2-2";
i3-msg "workspace 2, move workspace to output DP-2-3";
i3-msg "workspace 3, move workspace to output eDP-1"
i3-msg "workspace 4, move workspace to output eDP-1"
echo "Layout applied"
fi
if [[ "$(ip a | grep '00:50:b6:f7:e5:d3' | wc -l)" == 1 ]]; then
/home/tanguy/.screenlayout/tegl-e5-d3.sh
i3-msg "workspace 1, move workspace to output DVI-I-2-2";
i3-msg "workspace 2, move workspace to output DVI-I-1-1";
i3-msg "workspace 3, move workspace to output eDP-1"
i3-msg "workspace 4, move workspace to output eDP-1"
fi
/home/tanguy/.config/polybar/launch.sh > /dev/null 2>&1
#/home/tanguy/.config/polybar/launch.sh > /dev/null 2>&1