aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/panel.sh
diff options
context:
space:
mode:
Diffstat (limited to '.config/herbstluftwm/panel.sh')
-rwxr-xr-x.config/herbstluftwm/panel.sh62
1 files changed, 40 insertions, 22 deletions
diff --git a/.config/herbstluftwm/panel.sh b/.config/herbstluftwm/panel.sh
index 6afe2cb..2a15462 100755
--- a/.config/herbstluftwm/panel.sh
+++ b/.config/herbstluftwm/panel.sh
@@ -21,6 +21,25 @@ source ~/.config/init/vars
# set alpha for background colours
alpha='#ff'
+
+std_black=$(echo -n '#ff'; echo "$std_black" | tr -d '#')
+std_red=$(echo -n '#ff'; echo "$std_red" | tr -d '#')
+std_green=$(echo -n '#ff'; echo "$std_green" | tr -d '#')
+std_yellow=$(echo -n '#ff'; echo "$std_yellow" | tr -d '#')
+std_blue=$(echo -n '#ff'; echo "$std_blue" | tr -d '#')
+std_magenta=$(echo -n '#ff'; echo "$std_magenta" | tr -d '#')
+std_cyan=$(echo -n '#ff'; echo "$std_cyan" | tr -d '#')
+std_white=$(echo -n '#ff'; echo "$std_white" | tr -d '#')
+
+light_black=$(echo -n '#ff'; echo "$light_black" | tr -d '#')
+light_red=$(echo -n '#ff'; echo "$light_red" | tr -d '#')
+light_green=$(echo -n '#ff'; echo "$light_green" | tr -d '#')
+light_yellow=$(echo -n '#ff'; echo "$light_yellow" | tr -d '#')
+light_blue=$(echo -n '#ff'; echo "$light_blue" | tr -d '#')
+light_magenta=$(echo -n '#ff'; echo "$light_magenta" | tr -d '#')
+light_cyan=$(echo -n '#ff'; echo "$light_cyan" | tr -d '#')
+light_white=$(echo -n '#ff'; echo "$light_white" | tr -d '#')
+
bg_normal=$(echo -n $alpha; echo "$bg_normal" | tr -d '#')
fg_normal=$(echo -n '#ff'; echo "$fg_normal" | tr -d '#')
bg_focus=$(echo -n $alpha; echo "$bg_focus" | tr -d '#')
@@ -28,11 +47,8 @@ fg_focus=$(echo -n '#ff'; echo "$fg_focus" | tr -d '#')
bg_urgent=$(echo -n $alpha; echo "$bg_urgent" | tr -d '#')
fg_urgent=$(echo -n '#ff'; echo "$fg_urgent" | tr -d '#')
-fg_grey=$(echo -n '#ff'; echo "$fg_grey" | tr -d '#')
-fg_red=$(echo -n '#ff'; echo "$fg_red" | tr -d '#')
-fg_green=$(echo -n '#ff'; echo "$fg_green" | tr -d '#')
-fg_yellow=$(echo -n '#ff'; echo "$fg_yellow" | tr -d '#')
-fg_blue=$(echo -n '#ff'; echo "$fg_blue" | tr -d '#')
+# separator macro
+sep="%{F${bg_focus}}│%{F${fg_normal}}"
hc pad $monitor $bheight
@@ -53,9 +69,9 @@ update_taglist() {
-e 's/:/ /' \
-e "s/[#+\-%]\(.*\)/%{B${bg_focus} F${fg_focus}} \1%{B${bg_normal} F${fg_normal}}/" \
-e "s/!\(.*\)/%{B${bg_urgent} F${fg_urgent}} \1%{B${bg_normal} F${fg_normal}}/" \
- -e "s/\.\(.*\)/%{B${bg_normal} F${fg_grey}} \1%{B${bg_normal} F${fg_normal}}/" \
+ -e "s/\.\(.*\)/%{B${bg_normal} F${light_black}} \1%{B${bg_normal} F${fg_normal}}/" \
| tr -d '\n'
- echo "%{F${bg_focus}}|%{F${fg_normal}}"
+ echo "$sep"
}
update_winlist() {
@@ -80,14 +96,14 @@ update_winlist() {
else
echo -n "%{B${bg_normal} F${fg_normal}} "
fi
- echo -n "${line[@]:3}" | sed -r 's/(.{60}).*/\1\.\.\./'
+ echo -n "${line[@]:3}" | sed -r 's/(.{40}).*/\1\.\.\./'
echo -n " "
done
echo -n "%{B${bg_normal} F${fg_normal}}"
}
update_date() {
- echo -n "%{F${bg_focus}}|%{F${fg_normal} A:date:} \uE015 "
+ echo -n "${sep}%{A:date:} \uE015 "
date +$'%a, %b %d, %H:%M:%S' | tr -d '\n'
echo " %{A}"
}
@@ -156,7 +172,7 @@ event_mpd() {
done > >(unique_line)
}
-event_stat() {
+event_stats() {
conky -c ~/.config/herbstluftwm/panel/conky_stats
}
@@ -183,7 +199,7 @@ event_when() {
{
event_tick &
echo -e "child\t$!"
- event_stat &
+ event_stats &
echo -e "child\t$!"
event_when &
echo -e "child\t$!"
@@ -217,19 +233,19 @@ event_when() {
;;
mpd)
- fields[5]="%{F${bg_focus}}|%{A:mpd: F"
+ fields[5]="${sep}%{A:mpd: F"
case "${event[1]}" in
playing)
- fields[5]+=$(echo -n "${fg_green}} \uE0FE \uE09A")
+ fields[5]+=$(echo -n "${std_green}} \uE0FE \uE09A")
;;
paused)
- fields[5]+=$(echo -n "${fg_yellow}} \uE0FE \uE09B")
+ fields[5]+=$(echo -n "${std_yellow}} \uE0FE \uE09B")
;;
stopped)
- fields[5]+=$(echo -n "${fg_blue}} \uE0FE \uE099")
+ fields[5]+=$(echo -n "${std_blue}} \uE0FE \uE099")
;;
*)
- fields[5]+=$(echo -n "${fg_red}} \uE0FE \uE09E")
+ fields[5]+=$(echo -n "${std_red}} \uE0FE \uE09E")
;;
esac
fields[5]+=" %{F${fg_normal} A}"
@@ -239,16 +255,16 @@ event_when() {
event[1]=$(printf "%-4s" ${event[1]})
event[2]=$(printf "%-4s" ${event[2]})
fields[6]=$(
- echo -n "%{F${bg_focus}}|%{F${fg_normal} A:stats:} "
- echo -n "%{F${fg_blue}}\uE023%{F${fg_normal}} ${event[1]} "
- echo -n "%{F${fg_yellow}}\uE020%{F${fg_normal}} ${event[2]} "
+ echo -n "${sep}%{A:stats:} "
+ echo -n "%{F${std_blue}}\uE023%{F${fg_normal}} ${event[1]} "
+ echo -n "%{F${std_cyan}}\uE020%{F${fg_normal}} ${event[2]} "
echo -n "%{A}")
;;
when)
if [[ "${event[1]}" -eq 1 ]]; then
- fields[4]=$(echo -n "%{F${bg_focus}}|%{F${fg_normal} A:when:}"
- echo -n "%{F${fg_yellow}} \uE0AE %{F${fg_normal} A}")
+ fields[4]=$(echo -n "${sep}%{A:when:}"
+ echo -n "%{F${std_red}} \uE0AE %{F${fg_normal} A}")
else
fields[4]=""
fi
@@ -286,7 +302,9 @@ event_when() {
done
# pass the events into bar
-} 2> /dev/null | lemonbar -f "$bfont1" -f "$bfont2" \
+} 2> /dev/null | lemonbar -f "$ifont" -o "$ifont_off" \
+ -f "${bfont}:size=${bfont_size}" -o "$bfont_off" \
+ -f "${jfont}:size=${jfont_size}" -o "$jfont_off" \
-g${width}x${bheight}+${xpos}+${ypos} \
-B ${bg_normal} -F ${fg_normal} | \
{