57 lines
1.6 KiB
Bash
Executable File
57 lines
1.6 KiB
Bash
Executable File
# This is a hack of i3-bar with herbstluftwm
|
|
#
|
|
# I don't remember what exactly is going on, but it works.
|
|
# Eventually I need to write my own bar that itegrates better
|
|
# with herbstluft because I don't have things like a tag list
|
|
# with clickable tag switchers
|
|
|
|
# Load fonts in case they haven't been loaded in X (thanks dzen2)
|
|
FONT_DIRS=(/usr/share/fonts/TTF/ /usr/share/fonts/OTF/ /usr/share/fonts)
|
|
for dir in $FONT_DIRS; do xset +fp $dir; done && xset fp rehash
|
|
|
|
CFGDIR="$HOME/.config/herbstluftwm/"
|
|
|
|
# -------------------------------
|
|
# Init stuff stolen from other bar script
|
|
# -------------------------------
|
|
|
|
quote() {
|
|
local q="$(printf '%q ' "$@")"
|
|
printf '%s' "${q% }"
|
|
}
|
|
|
|
hc_quoted="$(quote "${herbstclient_command[@]:-herbstclient}")"
|
|
hc() { "${herbstclient_command[@]:-herbstclient}" "$@"; }
|
|
monitor=${1:-0}
|
|
geometry=($(hc monitor_rect "$monitor"))
|
|
if [ -z "$geometry" ]; then
|
|
echo "Invalid monitor $monitor"
|
|
exit 1
|
|
fi
|
|
|
|
# geometry has the format X Y W H
|
|
x=${geometry[0]}
|
|
y=${geometry[1]}
|
|
mon_width=${geometry[2]}
|
|
mon_height=${geometry[3]}
|
|
|
|
panel_x=$x
|
|
panel_height=16
|
|
panel_width=$mon_width
|
|
panel_y=$((mon_height - panel_height))
|
|
|
|
font="-*-fixed-medium-*-*-*-14-*-*-*-*-*-*-*"
|
|
|
|
bgcolor=$(hc get frame_border_normal_color | sed 's,^\(\#[0-9a-f]\{6\}\)[0-9a-f]\{2\}$,\1,')
|
|
selbg=$(hc get window_border_active_color | sed 's,^\(\#[0-9a-f]\{6\}\)[0-9a-f]\{2\}$,\1,')
|
|
selfg='#101010'
|
|
|
|
# -------------------------------
|
|
|
|
# Pad the bottom of the monitor for the bar to live
|
|
hc pad $monitor 0 0 $panel_height 0
|
|
|
|
i3status -c $CFGDIR/i3status.conf | dzen2 \
|
|
-w $panel_width -x $panel_x -y $panel_y -h $panel_height -ta r \
|
|
-fn "$font" -bg "$bgcolor" -fg '#efefef'
|