lemonbar with light theme

This commit is contained in:
Enrico Fasoli 2015-10-12 16:55:33 +02:00
parent 8cfae8a7cf
commit 8e59aee4b8

View File

@ -1,15 +1,16 @@
GREY="#5f5f5f" GREY="#5f5f5f"
WHITE="#9b9081" WHITE="#93a1a1"
WHITE2="#b3b3b3" WHITE2="#fdf6e3"
BLACK="#181b20" BLACK="#181b20"
RED="#6b4a49" RED="#dc322f"
BLUE="#435861" BLUE="#2aa198"
GREEN="#6f6749" GREEN="#859900"
GREEN2="#6d6137" BROWN="#b58900"
BROWN="#776049" FG="#586e75"
BG="#dfdfdf"
buildClock() { buildClock() {
echo -n "%{F$WHITE2}$(date "+%A, %e %B, %k:%M")" echo -n "%{F$FG}$(date "+%A, %e %B, %k:%M")"
} }
getVolume() { getVolume() {
@ -18,12 +19,8 @@ getVolume() {
COLOR= COLOR=
if [ $ONOFF == "[off]" ]; then if [ $ONOFF == "[off]" ]; then
COLOR=$RED COLOR=$RED
elif [ $VOLUME -gt 60 ]; then
COLOR=$GREEN2
elif [ $VOLUME -gt 35 ]; then
COLOR=$GREEN
else else
COLOR=$GREY COLOR=$FG
fi fi
VOLUME=$(spark $VOLUME 0 100 | tail -n 1 | cut -b1-3) VOLUME=$(spark $VOLUME 0 100 | tail -n 1 | cut -b1-3)
echo -n "%{F$COLOR}$VOLUME" echo -n "%{F$COLOR}$VOLUME"
@ -35,7 +32,7 @@ getMPD(){
PERC=$(echo "$(echo $MPD2 | cut -d ' ' -f4 | cut -b2-3 | cut -d '%' -f1) 0 100" | spark | tail -n 1 | cut -b1-3) PERC=$(echo "$(echo $MPD2 | cut -d ' ' -f4 | cut -b2-3 | cut -d '%' -f1) 0 100" | spark | tail -n 1 | cut -b1-3)
#PERC=$(echo "$(echo $MPD2 | cut -d ' ' -f4 | cut -b2-3 | cut -d '%' -f1) 0 100" | spark | cut -b 1-3) #PERC=$(echo "$(echo $MPD2 | cut -d ' ' -f4 | cut -b2-3 | cut -d '%' -f1) 0 100" | spark | cut -b 1-3)
if [ "$(mpc | wc -l)" -gt 1 ]; then if [ "$(mpc | wc -l)" -gt 1 ]; then
echo -n "%{F$BLUE}♫ %{F$BROWN}$MPD1 %{F$BLUE}♫ $PERC %{F$GREY}$(echo -n $MPD2 | cut -d ' ' -f1,2)" echo -n "%{F$BLUE}♫ %{F#6c71c4}$MPD1 %{F$BLUE}♫ $PERC %{F$FG}$(echo -n $MPD2 | cut -d ' ' -f1,2)"
fi fi
} }
@ -45,11 +42,11 @@ getNET(){
NNAME=$(echo $NDATA | cut -d' ' -f2) NNAME=$(echo $NDATA | cut -d' ' -f2)
if [ "$NSTATE" == "c" ]; then if [ "$NSTATE" == "c" ]; then
NCOLOR="$GREY" NCOLOR="$BLACK"
elif [ "$NSTATE" == "R" ]; then elif [ "$NSTATE" == "R" ]; then
NCOLOR="$BLUE" NCOLOR="$BLUE"
elif [ "$NSTATE" == "O" ]; then elif [ "$NSTATE" == "O" ]; then
NCOLOR="$GREEN" NCOLOR="$FG"
else else
NCOLOR="$RED" NCOLOR="$RED"
fi fi
@ -62,16 +59,16 @@ getNET(){
} }
getDISK(){ getDISK(){
echo -n "%{F$BLUE}$(echo "$(du -ms ~ | cut -d$'\t' -f1)/1000" | bc) GB" echo -n "%{F$FG}$(echo "$(du -ms ~ | cut -d$'\t' -f1)/1000" | bc) GB"
} }
separator(){ separator(){
echo -n "%{F$GREY}◆" echo -n " "
} }
getLOAD(){ getLOAD(){
LOAD=$(echo -n "$(cat /proc/loadavg | cut -d ' ' -f 1-3) $(egrep -c '^processor' /proc/cpuinfo)00 0" | sed 's/\(0\.\|0\.0\|\.\)//g' | sed 's/800/300/g' | spark | tail -n 1 | cut -b 1-9) LOAD=$(echo -n "$(cat /proc/loadavg | cut -d ' ' -f 1-3) $(egrep -c '^processor' /proc/cpuinfo)00 0" | sed 's/\(0\.\|0\.0\|\.\)//g' | sed 's/800/300/g' | spark | tail -n 1 | cut -b 1-9)
echo -n "%{F$BLUE}$LOAD" echo -n "%{F$FG}$LOAD"
} }
getMEM(){ getMEM(){
@ -81,12 +78,17 @@ getMEM(){
not_apps=$((not_apps+mem)) not_apps=$((not_apps+mem))
done done
USEDMEM=$(echo "$((total-not_apps))/1000" | bc) USEDMEM=$(echo "$((total-not_apps))/1000" | bc)
echo -n "%{F$BLUE}$USEDMEM MB" echo -n "%{F$FG}$USEDMEM MB"
} }
getBAT(){ getBAT(){
BAT=$(acpi -b | head -n1 | cut -d ' ' -f4 | cut -d '%' -f1) BAT=$(acpi -b | head -n1 | cut -d ' ' -f4 | cut -d '%' -f1)
echo -n "%{F$GREY}$BAT $(echo $BAT 0 100 | spark | cut -b 1-3)" echo -n "%{F$FG}$BAT $(echo $BAT 0 100 | spark | cut -b 1-3)"
}
getWORKSPC(){
FOC="$(bspc query -D -d focused)"
echo -n "%{B$FG}%{F$BG} $FOC %{B$BG}"
} }
buildBar () { buildBar () {
@ -97,4 +99,4 @@ buildBar () {
done done
} }
buildBar | lemonbar -p -g "1920x20" -B "$BLACK" -F "$GREY" -f -gohu-gohufont-medium-r-normal--14-100-100-100-c-80-iso10646-1 buildBar | lemonbar -p -g "1890x20+15" -B "#dfdfdf" -F "$FG" -f "xft:DejaVu Sans Mono:size=11"