summaryrefslogtreecommitdiffstats
path: root/.scripts/statusbar
diff options
context:
space:
mode:
Diffstat (limited to '.scripts/statusbar')
-rwxr-xr-x.scripts/statusbar/battery16
-rwxr-xr-x.scripts/statusbar/mailbox3
-rwxr-xr-x.scripts/statusbar/mpdupdate3
-rwxr-xr-x.scripts/statusbar/popupgrade1
-rwxr-xr-x.scripts/statusbar/torrent5
5 files changed, 13 insertions, 15 deletions
diff --git a/.scripts/statusbar/battery b/.scripts/statusbar/battery
index b2634e6..e5f6ec7 100755
--- a/.scripts/statusbar/battery
+++ b/.scripts/statusbar/battery
@@ -1,12 +1,10 @@
#!/bin/sh
# Give a battery name (e.g. BAT0) as an argument.
-# get xresources colors
-for x in "$(xrdb -query | sed "s/.*\./export /g;s/:\s*/=\"/g;s/$/\"/g")"; do eval "$x"; done
-
case $BLOCK_BUTTON in
3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b>
🔋: discharging
+🛑: not charging
♻: stagnant charge
🔌: charging
⚡: charged
@@ -18,18 +16,18 @@ capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit
status=$(cat /sys/class/power_supply/"$1"/status)
if [ "$capacity" -ge 75 ]; then
- color="$color10"
+ color="#00ff00"
elif [ "$capacity" -ge 50 ]; then
- color="$color15"
+ color="#ffffff"
elif [ "$capacity" -ge 25 ]; then
- color="$color11"
+ color="#ffff00"
else
- color="$color9"
+ color="#ff0000"
warn="❗"
fi
[ -z $warn ] && warn=" "
-[ "$status" = "Charging" ] && color="$color15"
+[ "$status" = "Charging" ] && color="#ffffff"
-printf "<span color='%s'>%s%s%s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$warn" "$(echo "$capacity" | sed -e 's/$/%/')"
+printf "<span color='%s'>%s%s%s</span>" "$color" "$(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/$/%/')"
diff --git a/.scripts/statusbar/mailbox b/.scripts/statusbar/mailbox
index bb72c5d..0c5ccbe 100755
--- a/.scripts/statusbar/mailbox
+++ b/.scripts/statusbar/mailbox
@@ -14,5 +14,4 @@ case $BLOCK_BUTTON in
- Middle click syncs mail" ;;
esac
-echo "$(du -a ~/.mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat ~/.config/mutt/.dl 2>/dev/null)"
-
+echo "$(du -a ~/.mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon 2>/dev/null)"
diff --git a/.scripts/statusbar/mpdupdate b/.scripts/statusbar/mpdupdate
index 84c7ab1..9a57ca4 100755
--- a/.scripts/statusbar/mpdupdate
+++ b/.scripts/statusbar/mpdupdate
@@ -1,8 +1,7 @@
#!/bin/sh
-
[ "$(pgrep -x "$(basename "$0")" | wc -l)" -gt 2 ] && exit
-while : ; do
+sleep 5 && while : ; do
pgrep -x mpd || exit
mpc idle > /dev/null
pkill -RTMIN+11 i3blocks ;
diff --git a/.scripts/statusbar/popupgrade b/.scripts/statusbar/popupgrade
index 739fcb7..83035c3 100755
--- a/.scripts/statusbar/popupgrade
+++ b/.scripts/statusbar/popupgrade
@@ -3,7 +3,6 @@
printf "Beginning upgrade.\\n"
yay -Syu
-pacman -Qu | wc -l > ~/.pacupgrnum
pkill -RTMIN+8 i3blocks
printf "\\nUpgrade complete.\\nPress <Enter> to exit window.\\n\\n"
diff --git a/.scripts/statusbar/torrent b/.scripts/statusbar/torrent
index 06ddd3e..8534cb1 100755
--- a/.scripts/statusbar/torrent
+++ b/.scripts/statusbar/torrent
@@ -6,10 +6,12 @@ transmission-remote -l | grep % |
s/.*Seeding.*/Z/g;
s/.*100%.*/N/g;
s/.*Idle.*/B/g;
+ s/.*Uploading.*/L/g;
s/.*%.*/M/g" |
sort -h | uniq -c | sed " # Now we replace the standin letters with icons.
s/A/🛑/g;
s/B/⌛️/g;
+ s/L/🔼/g;
s/M/🔽/g;
s/N/✅/g;
s/Z/🌱/g" | awk '{print $2, $1}' | tr '\n' ' ' | sed -e "s/ $//g"
@@ -18,7 +20,8 @@ case $BLOCK_BUTTON in
1) $TERMINAL -e transmission-remote-cli ;;
3) pgrep -x dunst >/dev/null && notify-send "<b>Torrent module:</b>
🛑: paused
-⏳: waiting
+⏳: idle (seeds needed)
+🔼: uploading (unfinished)
🔽: downloading
✅: done
🌱: done and seeding" ;;