diff options
Diffstat (limited to 'mac/.config/sketchybar.mon/plugins/disk.sh')
| -rwxr-xr-x | mac/.config/sketchybar.mon/plugins/disk.sh | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/mac/.config/sketchybar.mon/plugins/disk.sh b/mac/.config/sketchybar.mon/plugins/disk.sh new file mode 100755 index 0000000..f2adc30 --- /dev/null +++ b/mac/.config/sketchybar.mon/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 |
