#! /bin/bash # Autostart pgrep -x sxhkd > /dev/null || sxhkd & xrdb -load $HOME/.config/.Xresources & dunst -conf $HOME/.config/dunst/dunstrc & picom --experimental-backends & $HOME/.fehbg & /usr/lib/kdeconnectd & disown nextcloud & disown xset -b DISPLAYS=$(xrandr -q | grep -w 'connected' | cut -d ' ' -f 1) EXT_PRIMARY="" INTEGRATED_DISPLAY=$(xrandr -q | grep -w 'connected primary' | cut -d ' ' -f 1) for DISP in ${DISPLAYS}; do if [ ${DISP} != ${INTEGRATED_DISPLAY} ]; then EXT_PRIMARY=${DISP} fi done killall -q polybar if [ "${EXT_PRIMARY}" != "" ]; then xrandr --output ${EXT_PRIMARY} --primary --output ${INTEGRATED_DISPLAY} --right-of ${EXT_PRIMARY} bspc monitor ${EXT_PRIMARY} -d 1 2 3 4 5 bspc monitor ${INTEGRATED_DISPLAY} -d 6 7 8 9 0 MONITOR=${EXT_PRIMARY} polybar main 2>&1 | tee -a /tmp/polybar.log & disown else bspc monitor ${INTEGRATED_DISPLAY} -d 1 2 3 4 5 6 7 8 9 0 fi MONITOR=${INTEGRATED_DISPLAY} polybar main 2>&1 | tee -a /tmp/polybar.log & disown bspc config border_width 0 bspc config window_gap 8 bspc config top_padding 20 bspc config split_ratio 0.6 # Fix for Java applications wmname LG3D