This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/wm/extras/bar/start.bash

42 lines
1 KiB
Bash
Raw Normal View History

2016-01-07 02:16:53 -06:00
#!/usr/bin/env bash
source "$DOTFILES_PATH/variables.bash"
2016-01-12 15:02:12 -06:00
export BAR_RUNNING=1
2016-01-07 02:16:53 -06:00
function killbar() {
2016-01-12 15:02:12 -06:00
export BAR_RUNNING=0
2016-01-07 02:16:53 -06:00
if [ $BAR_TOP -eq 1 ]; then
bspc config -m $(bspc query -M | head -n 1) top_padding "0"
else
bspc config -m $(bspc query -M | head -n 1) bottom_padding "0"
fi
}
2016-01-11 09:22:54 -06:00
trap killbar INT TERM QUIT EXIT
rm -f "$BAR_FIFO"
mkfifo "$BAR_FIFO"
2016-01-07 02:16:53 -06:00
if [ $BAR_TOP -eq 1 ]; then
bspc config -m $(bspc query -M | head -n 1) top_padding "$BAR_HEIGHT"
else
bspc config -m $(bspc query -M | head -n 1) bottom_padding "$BAR_HEIGHT"
fi
# get width of our main monitor
WIDTH=`xrandr -q | egrep '(^| )connected( |$)' | tr 'x' '\n' | head -n 1 | awk '{print $NF}'`
WIDTH=$((WIDTH-BAR_MARGIN-BAR_MARGIN))
2016-01-11 09:22:54 -06:00
BAR_B=""
2016-01-07 02:16:53 -06:00
if [ $BAR_TOP -eq 1 ]; then
:
else
2016-01-11 09:22:54 -06:00
BAR_B="-b"
2016-01-07 02:16:53 -06:00
fi
2016-01-11 09:22:54 -06:00
source "$DOTFILES_PATH/wm/extras/bar/colors.bash"
2016-01-13 00:21:07 -06:00
cat "$BAR_FIFO" | "$DOTFILES_PATH/wm/extras/bar/formatter.bash" | lemonbar $BAR_B -g "$WIDTH"x"$BAR_HEIGHT"+"$BAR_MARGIN"+"$POS_Y" -u "$BAR_BORDER_WIDTH" -f "$BAR_FONT_FAMILY" -F "$COLOR_FOREGROUND" -B "$COLOR_BACKGROUND"
2016-01-12 15:02:12 -06:00
killbar