summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar/plugins/disk.sh
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-01-24 20:35:27 +0900
commitc80a54e42b52ce297f0f2f71af23c562832025c7 (patch)
treedcce8bb977a770f473325d48f6f70b21d9818a40 /mac/.config/sketchybar/plugins/disk.sh
init
Diffstat (limited to 'mac/.config/sketchybar/plugins/disk.sh')
-rw-r--r--mac/.config/sketchybar/plugins/disk.sh29
1 files changed, 29 insertions, 0 deletions
diff --git a/mac/.config/sketchybar/plugins/disk.sh b/mac/.config/sketchybar/plugins/disk.sh
new file mode 100644
index 0000000..f2adc30
--- /dev/null
+++ b/mac/.config/sketchybar/plugins/disk.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+source "$CONFIG_DIR/globalstyles.sh"
+
+COUNT="$(df -H | grep -E '^(/dev/disk3s5)' | awk '{ printf ("%s\n", $5) }' | sed 's/%//')"
+
+COLOR=$RED
+
+case "$COUNT" in
+[7-8][0-9]) # 70-89%
+ COLOR=$PEACH
+ ;;
+[5-6][0-9]) # 50-69%
+ COLOR=$YELLOW
+ ;;
+[3-4][0-9]) # 20-49%
+ COLOR=$GREEN
+ ;;
+[1-2][0-9]) # 10-19%
+ COLOR=$LAVENDER
+ ;;
+[0-9]) # 0-9%
+ COLOR=$WHITE
+ ;;
+esac
+
+sketchybar -m --set "$NAME" \
+ label="$COUNT%" \
+ icon.color=$COLOR