dotfiles/.config/bspwm/bspwmrc

43 lines
1.0 KiB
Plaintext
Raw Normal View History

#! /bin/bash
# Enable debug
set -x
# Autostart
pgrep -x sxhkd > /dev/null || sxhkd & disown
xrdb -load $HOME/.config/.Xresources &
dunst -conf $HOME/.config/dunst/dunstrc &
picom --experimental-backends &
$HOME/.fehbg &
/usr/lib/kdeconnectd & disown
pgrep 'nextcloud' || nextcloud & disown
killall polybar
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