mirror of
https://github.com/tomru/hlwm-config.git
synced 2026-03-02 22:17:20 +01:00
57 lines
1.4 KiB
Bash
Executable File
57 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
font="PragmataPro Mono Liga:pixelsize=15"
|
|
|
|
function uniq_linebuffered() {
|
|
awk -W interactive '$0 != l { print ; l=$0 ; fflush(); }' "$@"
|
|
}
|
|
|
|
# disable path name expansion or * will be expanded in the line
|
|
# cmd=( $line )
|
|
|
|
statusbar_height=20
|
|
monitor=${1:-0}
|
|
geometry=( $(herbstclient monitor_rect "$monitor") )
|
|
if [ -z "$geometry" ] ;then
|
|
echo "Invalid monitor $monitor"
|
|
exit 1
|
|
fi
|
|
# geometry has the format: WxH+X+Y
|
|
x=${geometry[0]}
|
|
y=$((${geometry[3]} - $statusbar_height))
|
|
screen_width=${geometry[2]}
|
|
panelGeometry=${geometry[2]}x${statusbar_height}+${x}+${y}
|
|
{
|
|
conky -c $HOME/.config/herbstluftwm/conkyrc | while read -r; do
|
|
echo -e "$REPLY";
|
|
done > >(uniq_linebuffered) &
|
|
childpid=$!
|
|
herbstclient --idle
|
|
kill $childpid
|
|
} 2> /dev/null | {
|
|
while true ; do
|
|
read line || break
|
|
cmd=( $line )
|
|
# find out event origin
|
|
case "${cmd[0]}" in
|
|
focus_changed|window_title_changed|tag_changed|tag_flags)
|
|
;;
|
|
quit_panel)
|
|
exit
|
|
;;
|
|
reload)
|
|
exit
|
|
;;
|
|
*)
|
|
echo $line
|
|
;;
|
|
esac
|
|
done
|
|
} 2> /dev/null \
|
|
| lemonbar \
|
|
-g $panelGeometry \
|
|
-f "$font" \
|
|
-f '-wuncon-siji-medium-r-normal--10-100-75-75-c-80-iso10646-1' \
|
|
-B $GRUVBOX_DARK1 -F $GRUVBOX_LIGHT0 \
|
|
-u 2
|