aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Wittamore <philip@wittamore.com>2025-06-04 09:46:28 +0200
committerPhilip Wittamore <philip@wittamore.com>2025-06-04 09:46:28 +0200
commit669b6b86a128f7559b257e69f07e610e26d0cd23 (patch)
tree9b09193bb2ec1fb083ede6458be226314b918e4a
parent3430f835adb2a015c6b5eb66eb8fdf118d760c42 (diff)
downloadscripts-669b6b86a128f7559b257e69f07e610e26d0cd23.tar.gz
scripts-669b6b86a128f7559b257e69f07e610e26d0cd23.tar.bz2
scripts-669b6b86a128f7559b257e69f07e610e26d0cd23.zip
update
-rwxr-xr-xpw-battery31
-rwxr-xr-xpw-systemstats5
2 files changed, 24 insertions, 12 deletions
diff --git a/pw-battery b/pw-battery
index b6f78fe..3f3dea7 100755
--- a/pw-battery
+++ b/pw-battery
@@ -1,5 +1,6 @@
#!/bin/sh
# Display the current battery status.
+# requires joypixels font in dwm config.def.h
notify() {
dunstify \
@@ -9,10 +10,18 @@ notify() {
"Battery" "$1"
}
+
case "$BLOCK_BUTTON" in
# ugly must do better
- 1) notify "$(inxi -B --extra -c 0 -y 1 | sed -e 's/^[ \t]*//')" ;;
- 3) notify "$(acpi -b | awk -F ': |, ' '{printf "%s\n%s\n", $2, $4}')" ;;
+ 1)
+ INF=$(inxi -B --extra 3 -c 0 -y 1)
+ REM=$(acpi | cut -d , -f 3)
+ DAT=$(echo "$INF$REM" | sed -e 's/^[ \t]*//')
+ notify "$DAT"
+ ;;
+ 3)
+ notify "$(acpi -b | awk -F ': |, ' '{printf "%s\n%s\n", $2, $4}')"
+ ;;
esac
# Loop through all attached batteries.
@@ -22,30 +31,30 @@ for battery in /sys/class/power_supply/BAT?*; do
capacity="$(cat "$battery/capacity" 2>&1)"
if [ "$capacity" -gt 90 ]; then
- status="󰁹 "
+ status="✅ "
elif [ "$capacity" -gt 60 ]; then
- status="󰁿 "
+ status="🔋 "
elif [ "$capacity" -gt 40 ]; then
- status="󰁽 "
+ status="🪫 "
elif [ "$capacity" -gt 10 ]; then
- status="󰁺 "
+ status="⚠️ "
else
- status="󰂎 "
+ status="❌ "
fi
case "$(cat "$battery/status" 2>&1)" in
- Full) status="󱐋 " ;;
+ Full) status="⚡ " ;;
Discharging)
if [ "$capacity" -le 20 ]; then
status="$status"
color=1
fi
;;
- Charging) status="󰚥$status" ;;
- "Not charging") status=" " ;;
+ Charging) status="🔌$status" ;;
+ "Not charging") status="♻️" ;;
Unknown) status="? $status" ;;
*) exit 1 ;;
esac
- echo "| $status$capacity% |"
+ echo "┊ $status $capacity%"
done
diff --git a/pw-systemstats b/pw-systemstats
index 521b3a3..76cec99 100755
--- a/pw-systemstats
+++ b/pw-systemstats
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
+# requires joypixels font in dwm config.def.h
CPU_TEMP=$(sensors | awk '
/^Tdie|^Package id|^Core 0|^CPU|^temp1/ {
@@ -27,9 +28,11 @@ FAN_SPEED=$(sensors | awk '/^fan|^cpu_fan/ {print $2}')
# Send to bar
-echo " 󰈐 $FAN_SPEED   $CPU_TEMP°C"
+echo " 🌀 $FAN_SPEED ┊ 🌡️ $CPU_TEMP󰔄"
# Clicking on bar
case $BLOCK_BUTTON in
1) notify-send "$(sensors)";;
+ 2) notify-send "button 2 clicked";;
+ 3) notify-send "button 3 clicked";;
esac