DSK, Polybar: Trim down the startup script, make i3 the default restack

This commit is contained in:
Salt 2018-11-15 16:10:45 -06:00
parent 6bfd333051
commit d3964de65c
2 changed files with 10 additions and 13 deletions

View File

@ -1,18 +1,14 @@
#! /usr/bin/env bash #! /usr/bin/env bash
# Make sure we have our xrdb stuff going # Make sure we have our xrdb stuff going
if $(which xrdbupdate) > /dev/null 2>&1; then if which xrdbupdate > /dev/null 2>&1; then
xrdbupdate > /dev/null 2>&1 xrdbupdate > /dev/null 2>&1
fi fi
# Set some variables, if necessary
if [[ "$PB_BAR_BORDER_SIZE" == "" ]] && pgrep -U "$UID" bspwm > /dev/null 2>&1; then # Restack compatibility
if ! [[ "$BSPWM_WINDOW_GAP" == "" ]]; then if pgrep -U "$UID" bspwm > /dev/null 2>&1; then
echo "Inferring bar size from BSPWM_WINDOW_GAP" export PB_WM_RESTACK="bspwm"
export PB_BAR_BORDER_SIZE="$BSPWM_WINDOW_GAP"
fi
fi
if pgrep -U "$UID" i3 > /dev/null 2>&1; then
export PB_WM_RESTACK="i3"
fi fi
# Spawn bars on the primary monitor # Spawn bars on the primary monitor
export PB_MONITOR=$(xrandr -q | awk '/primary/{print $1}') export PB_MONITOR=$(xrandr -q | awk '/primary/{print $1}')
polybar -r primary & polybar -r primary &
@ -20,7 +16,7 @@ polybar -r primary-2 &
# Spawn more for each secondary # Spawn more for each secondary
export secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}') export secondary_monitors=$(xrandr -q | grep ' connected' | grep -v 'primary' | awk '{print $1}')
if [[ "$secondary_monitors" == "" ]]; then if [ "$secondary_monitors" == "" ]; then
return 0 return 0
fi fi
for monitor in $secondary_monitors; do for monitor in $secondary_monitors; do
@ -28,5 +24,6 @@ for monitor in $secondary_monitors; do
polybar -r secondary & polybar -r secondary &
polybar -r secondary-2 & polybar -r secondary-2 &
done done
return 0
# And wait
wait wait

View File

@ -55,7 +55,7 @@ font-4 = "Material Design Icons:size=11;3"
[template/bar] [template/bar]
# General ordering # General ordering
bottom = true bottom = true
wm-restack = ${env:PB_WM_RESTACK:bspwm} wm-restack = ${env:PB_WM_RESTACK:i3}
offset-y = 2 offset-y = 2
# Tray settings # Tray settings