107 lines
3.8 KiB
Bash
Executable File
107 lines
3.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
. panel_colors
|
|
|
|
num_mon=$(bspc query -M | wc -l)
|
|
PADDING=" "
|
|
SEP="|"
|
|
|
|
while read -r line ; do
|
|
case $line in
|
|
R*)
|
|
#ram output
|
|
ram="%{U$COLOR_UNDERLINE}%{+u}%{A:lemonram-notify:}${line#?}%{A}%{-u}$PADDING"
|
|
;;
|
|
C*)
|
|
#cpu output
|
|
cpu="%{U$COLOR_UNDERLINE}%{+u}%{A:lemoncpu-notify:}${line#?}%{A}%{-u}$PADDING"
|
|
;;
|
|
S*)
|
|
# mpc song status
|
|
state="%{F$COLOR_OCCUPIED_UNDERLINE}${line#?}%{F-}$PADDING"
|
|
;;
|
|
M*)
|
|
# mpc current song
|
|
song="%{F$COLOR_OCCUPIED_UNDERLINE}${line#?}%{F-}$PADDING"
|
|
;;
|
|
X*)
|
|
# xtitle output
|
|
title="$PADDING%{F$COLOR_TITLE}${line#?}%{F-}"
|
|
;;
|
|
D*)
|
|
#time and date output
|
|
date="%{U$COLOR_UNDERLINE}%{+u}${line#?}%{-u}"
|
|
;;
|
|
B*)
|
|
# battery output
|
|
batt="%{U$COLOR_UNDERLINE}%{+u}${line#?}%{-u}$PADDING"
|
|
;;
|
|
L*)
|
|
# backlight output
|
|
light="%{U$COLOR_UNDERLINE}%{+u}${line#?}%{-u}$PADDING"
|
|
;;
|
|
T*)
|
|
# cpu temperature
|
|
temp="%{U$COLOR_UNDERLINE}%{+u}${line#?}%{-u}$PADDING"
|
|
;;
|
|
N*)
|
|
# wifi output
|
|
wifi="%{U$COLOR_UNDERLINE}%{+u}${line#?}%{-u}$PADDING"
|
|
;;
|
|
V*)
|
|
# volume output
|
|
vol="%{U$COLOR_UNDERLINE}%{+u}${line#?}%{-u}$PADDING"
|
|
;;
|
|
W*)
|
|
# bspwm internal state
|
|
wm_infos=""
|
|
IFS=':'
|
|
set -- ${line#?}
|
|
while [ $# -gt 0 ] ; do
|
|
item=$1
|
|
name=${item#?}
|
|
case $item in
|
|
M*)
|
|
# active monitor
|
|
if [ $num_mon -gt 1 ] ; then
|
|
wm_infos="$wm_infos $SEP%{F$COLOR_ACTIVE_MONITOR_FG}%{B$COLOR_FOCUSED_OCCUPIED_FG}$PADDING${name}$PADDING%{B-}%{F-} "
|
|
fi
|
|
;;
|
|
m*)
|
|
# inactive monitor
|
|
if [ $num_mon -gt 1 ] ; then
|
|
wm_infos="$wm_infos $SEP%{F$COLOR_INACTIVE_MONITOR_FG}%{B$COLOR_INACTIVE_MONITOR_BG}$PADDING${name}$PADDING%{B-}%{F-} "
|
|
fi
|
|
;;
|
|
O*)
|
|
# focused occupied desktop
|
|
wm_infos="${wm_infos}$SEP%{F$COLOR_FOCUSED_OCCUPIED_FG}%{B$COLOR_FOCUSED_OCCUPIED_BG}%{U$COLOR_UNDERLINE}%{+u}$PADDING${name}$PADDING%{-u}%{B-}%{F-}"
|
|
;;
|
|
F*)
|
|
# focused free desktop
|
|
wm_infos="${wm_infos}$SEP%{F$COLOR_FOCUSED_FREE_FG}%{B$COLOR_FOCUSED_FREE_BG}%{U$COLOR_UNDERLINE}%{+u}$PADDING${name}$PADDING%{-u}%{B-}%{F-}"
|
|
;;
|
|
U*)
|
|
# focused urgent desktop
|
|
wm_infos="${wm_infos}$SEP%{F$COLOR_FOCUSED_URGENT_FG}%{B$COLOR_FOCUSED_URGENT_BG}%{U$COLOR_UNDERLINE}%{+u}$PADDING${name}$PADDING%{-u}%{B-}%{F-}"
|
|
;;
|
|
o*)
|
|
# occupied desktop
|
|
wm_infos="${wm_infos}$SEP%{F$COLOR_OCCUPIED_FG}%{B$COLOR_OCCUPIED_BG}%{A:bspc desktop -f ${name}:}%{U$COLOR_OCCUPIED_UNDERLINE}%{+u}$PADDING${name}$PADDING%{-u}%{A}%{B-}%{F-}"
|
|
;;
|
|
f*)
|
|
# free desktop
|
|
wm_infos="${wm_infos}$SEP%{F$COLOR_FREE_FG}%{B$COLOR_FREE_BG}%{A:bspc desktop -f ${name}:}$PADDING${name}$PADDING%{A}%{B-}%{F-}"
|
|
;;
|
|
u*)
|
|
# urgent desktop
|
|
wm_infos="${wm_infos}$SEP%{F$COLOR_URGENT_FG}%{B$COLOR_URGENT_BG}$PADDING${name}$PADDING%{B-}%{F-}"
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
;;
|
|
esac
|
|
printf "%s\n" "%{l}${wm_infos}${SEP}${title}%{c}${song}${state}%{r}${temp}${cpu}${ram}${wifi}${vol}${light}${batt}${date}"
|
|
done
|