diff --git a/.config/autorandr/postswitch b/.config/autorandr/postswitch index 8515209..6bc1850 100755 --- a/.config/autorandr/postswitch +++ b/.config/autorandr/postswitch @@ -1,4 +1,4 @@ #!/bin/bash dunstify "Autorandr" "Changed configuration to $AUTORANDR_CURRENT_PROFILE." -"${HOME}"/.config/bspwm/bspwmrc +"${HOME}"/.config/load_workspace.sh diff --git a/.config/bspwm/bspwmrc b/.config/bspwm/bspwmrc index 8628d10..a718fd1 100755 --- a/.config/bspwm/bspwmrc +++ b/.config/bspwm/bspwmrc @@ -4,39 +4,22 @@ set -x # Autostart +autorandr --change & disown pgrep -x sxhkd > /dev/null || sxhkd & disown -xrdb -load $HOME/.config/.Xresources & -dunst -conf $HOME/.config/dunst/dunstrc & -picom --experimental-backends & -$HOME/.fehbg & +xrdb -load $HOME/.config/.Xresources & disown +dunst -conf $HOME/.config/dunst/dunstrc & disown +picom --experimental-backends & disown /usr/lib/kdeconnectd & disown -pgrep 'nextcloud' || nextcloud & disown -killall polybar +nextcloud & disown xset -b -DISPLAYS=$(xrandr -q | grep -w 'connected' | grep -v 'primary' | cut -d ' ' -f 1) -PRIMARY_DISPLAY=$(xrandr -q | grep -w 'connected primary' | cut -d ' ' -f 1) - -echo "Displays '${DISPLAYS}' have been detected. '${PRIMARY_DISPLAY}' is primary." - bspc config border_width 0 bspc config window_gap 8 bspc config top_padding 20 bspc config split_ratio 0.6 -EXT_DISPLAY=${DISPLAYS%% *} - -killall -q polybar -if [ "${EXT_DISPLAY}" != "" ]; then - bspc monitor ${PRIMARY_DISPLAY} -d 1 2 3 4 5 - bspc monitor ${EXT_DISPLAY} -d 6 7 8 9 0 - MONITOR=${EXT_DISPLAY} polybar main & disown -else - bspc monitor ${PRIMARY_DISPLAY} -d 1 2 3 4 5 6 7 8 9 0 -fi - -MONITOR=${PRIMARY_DISPLAY} polybar main & disown - # Fix for Java applications wmname LG3D + +"${HOME}"/.config/load_workspace.sh & disown diff --git a/.config/load_workspace.sh b/.config/load_workspace.sh new file mode 100755 index 0000000..7eead20 --- /dev/null +++ b/.config/load_workspace.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +set -x + +$HOME/.fehbg & + +DISPLAYS=$(xrandr -q | grep -w 'connected' | grep -v 'primary' | cut -d ' ' -f 1) +PRIMARY_DISPLAY=$(xrandr -q | grep -w 'connected primary' | cut -d ' ' -f 1) + +echo "Displays '${DISPLAYS}' have been detected. '${PRIMARY_DISPLAY}' is primary." + +EXT_DISPLAY=${DISPLAYS%% *} + +killall -q polybar +if [ "${EXT_DISPLAY}" != "" ]; then + bspc monitor ${PRIMARY_DISPLAY} -d 1 2 3 4 5 + bspc monitor ${EXT_DISPLAY} -d 6 7 8 9 0 + MONITOR=${EXT_DISPLAY} polybar main & disown +else + bspc monitor ${PRIMARY_DISPLAY} -d 1 2 3 4 5 6 7 8 9 0 +fi + +MONITOR=${PRIMARY_DISPLAY} polybar main & disown