commit 6dc0a6699059f36a5e3961e7026ea667541a628f
parent 6941a2b1e34232a2ec90b7d9264070afc54015fe
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date: Sat, 6 Feb 2021 02:01:12 +0100
Change status bar icons
Diffstat:
5 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/.local/bin/dwmblocks/dwmb-backlight b/.local/bin/dwmblocks/dwmb-backlight
@@ -1,2 +1,2 @@
#!/usr/bin/env sh
-echo "☀ $(xbacklight -get)%" | sed "s/\.[0-9]*//g"
+echo " $(xbacklight -get)%" | sed "s/\.[0-9]*//g"
diff --git a/.local/bin/dwmblocks/dwmb-battery2 b/.local/bin/dwmblocks/dwmb-battery2
@@ -55,19 +55,32 @@ else:
FA_PLUG = "\uf1e6"
# stands for using battery
- FA_BATTERY = "\uf240"
+ FA_BATTERY_0 = "\uf244" # 0/4
+ FA_BATTERY_1 = "\uf243" # 1/4
+ FA_BATTERY_2 = "\uf242" # 2/4
+ FA_BATTERY_3 = "\uf241" # 3/4
+ FA_BATTERY_4 = "\uf240" # 4/4
# stands for unknown status of battery
FA_QUESTION = "\uf128"
if state == "Discharging":
- fulltext = FA_BATTERY + " "
+ if percentleft <= 10:
+ fulltext = FA_BATTERY_0 + " "
+ elif percentleft < 35:
+ fulltext = FA_BATTERY_1 + " "
+ elif percentleft < 65:
+ fulltext = FA_BATTERY_2 + " "
+ elif percentleft < 90:
+ fulltext = FA_BATTERY_3 + " "
+ else:
+ fulltext = FA_BATTERY_4 + " "
elif state == "Full":
fulltext = FA_PLUG + " "
timeleft = ""
elif state == "Unknown":
- fulltext = FA_QUESTION + " " + FA_BATTERY + " "
+ fulltext = FA_BATTERY_0 + " " + FA_QUESTION + " "
timeleft = ""
else:
fulltext = FA_LIGHTNING + " "
diff --git a/.local/bin/dwmblocks/dwmb-internet b/.local/bin/dwmblocks/dwmb-internet
@@ -1,11 +1,4 @@
#!/usr/bin/env sh
-# Show wifi 📶 and percent strength or 📡 if none.
-# Show 🌐 if connected to ethernet or ❎ if none.
-
-case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
- down) wifiicon="📡 " ;;
- up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
-esac
-
-printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)"
+[ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = "up" ] && \
+ printf "%s\n" "$(awk '/^\s*w/ { print "", int($3 * 100 / 70) "%" }' /proc/net/wireless)"
diff --git a/.local/bin/dwmblocks/dwmb-volume b/.local/bin/dwmblocks/dwmb-volume
@@ -11,7 +11,7 @@ AUDIO_MED_SYMBOL=${AUDIO_MED_SYMBOL:-""}
AUDIO_LOW_THRESH=${AUDIO_LOW_THRESH:-0}
AUDIO_LOW_SYMBOL=${AUDIO_LOW_SYMBOL:-""}
-AUDIO_MUTED_SYMBOL=${AUDIO_MUTED_SYMBOL:-""}
+AUDIO_MUTED_SYMBOL=${AUDIO_MUTED_SYMBOL:-""}
AUDIO_DELTA=${AUDIO_DELTA:-5}
diff --git a/.local/share/dwm/autostart.sh b/.local/share/dwm/autostart.sh
@@ -20,5 +20,5 @@ numlockx &
# configure monitors
$HOME/.local/bin/configure-monitors &
-xsetroot -name " $(date +"%a %d %b, %H:%M")" &
+xsetroot -name " $(date +"%a %d %b, %H:%M")" &
dwmblocks &