(i3) Add auto workspace setup and multi monitor dynamic configuration

This commit is contained in:
Tanguy Herbron 2022-12-06 15:33:02 +01:00
parent e0051c5123
commit e0b16539b4
3 changed files with 52 additions and 5 deletions

36
.bin/display Executable file
View File

@ -0,0 +1,36 @@
#!/bin/sh
export DISPLAY=:0
export XAUTHORITY=/home/tanguy/.Xauthority
/home/tanguy/.screenlayout/base.sh
# TODO : Configure each dock configuration with MAC addresses
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"
fi
if [[ "$(ip a | grep 'f4:a8:0d:41:e1:aa' | wc -l)" == 1 ]]; then
/home/tanguy/.screenlayout/tegl-e1-aa.sh
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"
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

9
.bin/swf Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
i3-msg "workspace 2; exec /usr/bin/firefox"
i3-msg "workspace 3; exec /usr/bin/teams"
i3-msg "workspace 3; exec /usr/bin/slack"
i3-msg "workspace 4; exec /usr/bin/element-desktop"
i3-msg "workspace 1; exec /usr/bin/alacritty"
sleep 1
i3-msg "workspace 1; fullscreen enable"

View File

@ -552,12 +552,12 @@ font $i3-wm.font
###############################################################################
# External programs launched with i3
# Program binding to specific workspace
###############################################################################
# Start the installed regolith-compositor
set_from_resource $i3-wm.program.compositor i3-wm.program.compositor /usr/share/regolith-compositor/init
exec --no-startup-id $i3-wm.program.compositor
for_window [class="Microsoft Teams - Preview"] move to workspace $ws3
for_window [class="Slack"] move to workspace $ws3
for_window [class="Element"] move to workspace $ws4
###############################################################################
# Automatically make some windows sticky
@ -578,7 +578,9 @@ exec_always --no-startup-id eww daemon &
# Drive automount deamon
exec_always --no-startup-id udiskie &
exec --no-startup-id /home/tanguy/multihead.sh
# Execute workspace configuration routine
exec --no-startup-id /home/tanguy/.bin/display
exec --no-startup-id /home/tanguy/.bin/swf
# Set the wallpaper last to avoid wallpaper missplacement
exec_always --no-startup-id feh --bg-scale ~/Images/Wallpapers/aerial_waves.jpg