Separated loading workspace and init script with bspwm so it can be run one or another

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2022-06-23 11:05:52 +02:00
parent 3fcc0c2073
commit 14ae6d7099
No known key found for this signature in database
GPG Key ID: 0C87282F76E61283
3 changed files with 31 additions and 25 deletions

View File

@ -1,4 +1,4 @@
#!/bin/bash #!/bin/bash
dunstify "Autorandr" "Changed configuration to $AUTORANDR_CURRENT_PROFILE." dunstify "Autorandr" "Changed configuration to $AUTORANDR_CURRENT_PROFILE."
"${HOME}"/.config/bspwm/bspwmrc "${HOME}"/.config/load_workspace.sh

View File

@ -4,39 +4,22 @@
set -x set -x
# Autostart # Autostart
autorandr --change & disown
pgrep -x sxhkd > /dev/null || sxhkd & disown pgrep -x sxhkd > /dev/null || sxhkd & disown
xrdb -load $HOME/.config/.Xresources & xrdb -load $HOME/.config/.Xresources & disown
dunst -conf $HOME/.config/dunst/dunstrc & dunst -conf $HOME/.config/dunst/dunstrc & disown
picom --experimental-backends & picom --experimental-backends & disown
$HOME/.fehbg &
/usr/lib/kdeconnectd & disown /usr/lib/kdeconnectd & disown
pgrep 'nextcloud' || nextcloud & disown nextcloud & disown
killall polybar
xset -b 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 border_width 0
bspc config window_gap 8 bspc config window_gap 8
bspc config top_padding 20 bspc config top_padding 20
bspc config split_ratio 0.6 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 # Fix for Java applications
wmname LG3D wmname LG3D
"${HOME}"/.config/load_workspace.sh & disown

23
.config/load_workspace.sh Executable file
View File

@ -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