statusbar: added background for icons

master
tiyn 1 year ago
parent bb7b37bb93
commit 6876ac5a72

@ -7,4 +7,4 @@ status=$(cat /sys/class/power_supply/"$1"/status)
[ "$status" = "Charging" ]
printf "%s%s" "$(echo "$status" | sed -e "s/,//;s/Discharging//;s/Not charging//;s/Charging//;s/Unknown//;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/' ) "
printf "%s%s" "$(echo "$status" | sed -e "s/,//;s/Discharging/^b#282828^^c#dfdfdf^ ^d^/;s/Not charging/^b#282828^^c#dfdfdf^ ^d^/;s/Charging/^b#282828^^c#dfdfdf^ ^d^/;s/Unknown/^b#282828^^c#dfdfdf^ ^d^/;s/Full/^b#282828^^c#dfdfdf^ ^d^/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/' ) "

@ -1,3 +1,3 @@
#!/bin/sh
date +" %d %b %H:%M"
date +"^b#282828^^c#dfdfdf^ ^d^ %d %b %H:%M"

@ -1,7 +1,7 @@
#!/bin/sh
if [ "$1" = "amd" ]; then
sensors | awk '/Tctl/ {print " " $2}'
sensors | awk '/Tctl/ {print "^b#282828^^c#dfdfdf^ ^d^ " $2}'
elif [ "$1" = "intel" ]; then
sensors | awk '/Core 0/ {print " " $3}'
sensors | awk '/Core 0/ {print "^b#282828^^c#dfdfdf^ ^d^ " $3}'
fi

@ -8,4 +8,4 @@ disk="/"
icon="$disk"
printf "󰗮 %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')"
printf "^b#282828^^c#dfdfdf^ 󰗮 ^d^ %s %s\n" "$icon" "$(df -h "$disk" | awk ' /[0-9]/ {print $3 "/" $2}')"

@ -1,8 +1,8 @@
#!/usr/bin/env sh
#
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon=" -%"
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon=" ^d^ -%"
[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print "", int($3 * 100 / 70) "%" }')
[ ! -n "${wifiicon+var}" ] && wifiicon=$(grep "^\s*w" /proc/net/wireless | awk '{ print " ^d^", int($3 * 100 / 70) "%" }')
printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down//;s/up/󰈀/")" "$wifiicon"
printf "%s %s\n" "$(cat /sys/class/net/e*/operstate | sed "s/down/^b#282828^^c#dfdfdf^ /;s/up/^b#282828^^c#dfdfdf^ 󰈀 /")" "$wifiicon"

@ -1,3 +1,3 @@
#!/bin/sh
free -h | awk '/^Mem:/ {print " " $3 "/" $2}'
free -h | awk '/^Mem:/ {print "^b#282828^^c#dfdfdf^ ^d^ " $3 "/" $2}'

@ -3,19 +3,19 @@
vol="$(pulsemixer --get-volume | awk '{print $1}')"
if [ "$vol" -eq "0" ]; then
icon=""
vol_info=" ^d^ $vol%"
elif [ "$vol" -gt "70" ]; then
icon=""
vol_info=" ^d^ $vol%"
else
icon=""
vol_info=" ^d^ $vol%"
fi
[ "$(pulsemixer --get-mute)" = "1" ] && icon="" && vol="-"
[ "$(pulsemixer --get-mute)" = "1" ] && vol_info=" ^d^ -%"
if amixer get Capture | tail -2 | grep -q '\[on\]'; then
mic=""
mic="^b#282828^^c#dfdfdf^ "
else
mic=""
mic="^b#282828^^c#dfdfdf^ "
fi
printf "%s %s %s\\n" "$mic" "$icon" "$vol%"
printf "%s %s %s\\n" "$mic" "$vol_info"

Loading…
Cancel
Save