mirror of
https://github.com/tomru/hlwm-config.git
synced 2026-03-03 06:27:20 +01:00
"initial" commit :D
This commit is contained in:
51
statusbar.sh
Executable file
51
statusbar.sh
Executable file
@@ -0,0 +1,51 @@
|
||||
#!/bin/bash
|
||||
source ~/.config/herbstluftwm/settings.sh
|
||||
|
||||
# disable path name expansion or * will be expanded in the line
|
||||
# cmd=( $line )
|
||||
set -f
|
||||
|
||||
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/idon/.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" \
|
||||
-B $bgcolor -F $fgcolor \
|
||||
-u 2
|
||||
Reference in New Issue
Block a user