2017-02-08 18:19:13 -06:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2017-02-11 14:00:54 -06:00
|
|
|
export BAR_MONITOR="$(polybar --list-monitors | tail -n 1 | sed -n 's/^\s*\(.*\):.*$/\1/p')"
|
2017-02-28 10:56:23 -06:00
|
|
|
export BAR_HEIGHT=40
|
2017-02-08 18:19:13 -06:00
|
|
|
export BAR_ON_TOP=0
|
|
|
|
export BAR_SIDE_MARGIN=200
|
|
|
|
|
2017-02-11 14:00:54 -06:00
|
|
|
echo "$BAR_MONITOR"
|
|
|
|
|
2017-02-08 18:19:13 -06:00
|
|
|
export GAP=$(bspc wm -d | grep -Po '(windowGap.*?,)' | grep -Po '\d*' | head -n 1)
|
2017-02-11 14:00:54 -06:00
|
|
|
MONITOR_WIDTH=$(xrandr | grep "$BAR_MONITOR" | grep -Po ' \d+' | head -n 1)
|
2017-02-08 18:19:13 -06:00
|
|
|
export BAR_WIDTH=$((MONITOR_WIDTH - GAP - GAP - BAR_SIDE_MARGIN - BAR_SIDE_MARGIN))
|
2017-02-10 11:23:52 -06:00
|
|
|
export BAR_FONT=$(xrdb -query | sed -ne 's/.*font:\s*xft:\(.*\)\-.*$/\1/p' | head -n 1)
|
|
|
|
export BAR_FONT_SIZE=$(xrdb -query | sed -ne 's/.*font:\s*xft:.*\-\(.*\)$/\1/p' | head -n 1)
|
2017-02-08 18:19:13 -06:00
|
|
|
export POS_X=$((GAP + BAR_SIDE_MARGIN))
|
|
|
|
|
|
|
|
export BAR_FONT_DECLARATION="${BAR_FONT}:pixelsize=${BAR_FONT_SIZE};1"
|
|
|
|
|
|
|
|
EHEIGHT=$((BAR_HEIGHT + GAP))
|
2017-02-22 19:01:27 -06:00
|
|
|
echo $EHEIGHT
|
2017-02-08 18:19:13 -06:00
|
|
|
|
|
|
|
export BAR_BOTTOM="true"
|
|
|
|
export POS_Y=0
|
|
|
|
if [ $BAR_ON_TOP -eq 1 ]; then
|
|
|
|
export BAR_BOTTOM="false"
|
|
|
|
export POS_Y=$GAP
|
2017-02-22 19:01:27 -06:00
|
|
|
bspc config -m ${BAR_MONITOR} top_padding "-$GAP"
|
2017-02-08 18:19:13 -06:00
|
|
|
bspc config -m ${BAR_MONITOR} bottom_padding "0"
|
|
|
|
else
|
|
|
|
export POS_Y=$GAP
|
|
|
|
bspc config -m ${BAR_MONITOR} top_padding "0"
|
2017-02-22 19:01:27 -06:00
|
|
|
bspc config -m ${BAR_MONITOR} bottom_padding "-$GAP"
|
2017-02-08 18:19:13 -06:00
|
|
|
fi
|
|
|
|
|
2017-02-20 18:38:20 -06:00
|
|
|
# bspc
|
2017-02-08 18:19:13 -06:00
|
|
|
|
|
|
|
polybar lytedev
|