CLI config/dotfiles
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

73 lines
1.5 KiB

#! /bin/sh
#
# Panel output config for lemonbar
while read -r line ; do
case $line in
S*)
# clock output
sys_infos="%{F-}${line#?}%{F-}"
;;
T*)
# xtitle output
title="%{F-}${line#?}%{F-}"
;;
W*)
# bspwm state
wm_infos=""
IFS=':'
set -- ${line#?}
while [ $# -gt 0 ] ; do
item=$1
name=${item#?}
case $item in
[mM]*)
case $item in
m*)
on_focused_monitor=
;;
M*)
on_focused_monitor=1
;;
esac
wm_infos="$wm_infos%{F-} %{F-}"
;;
[fFoOuU]*)
wm_infos="${wm_infos}%{A:bspc desktop -f ${name}:}"
case $item in
[OF]*)
if [ "$on_focused_monitor" ]; then
# focused desktop
wm_infos="$wm_infos%{F#EEFFFF} ● %{F-}"
else
# active desktop
wm_infos="$wm_infos%{F#FAE7BF} ● %{F-}"
fi
;;
U*)
# urgent focused desktop
wm_infos="$wm_infos%{F#FF0000} ● %{F-}"
;;
o*)
# inactive but occupied desktop
wm_infos="$wm_infos%{F-} ● %{F-}"
;;
f*)
# inactive desktop
wm_infos="$wm_infos%{F-} ○ %{F-}"
;;
u*)
# urgent desktop
wm_infos="$wm_infos%{F#FF0000} ○ %{F-}"
;;
esac
wm_infos="${wm_infos}%{A}"
;;
esac
shift
done
wm_infos="$wm_infos%{F-} %{F-}"
;;
esac
printf "%s\n" "%{S+}%{l}%{A:sysmenu:}  %{A}$title%{c}$wm_infos%{r}%{A:togglecal:}$sys_infos%{A} %{A:powermenu:}⏻%{A} "
done