From 130e628ab35de45226fb5b88f103c1938dacfc63 Mon Sep 17 00:00:00 2001 From: TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> Date: Sun, 24 Aug 2025 14:02:11 +0900 Subject: modified .gnupg/gpg-agent.conf, created sketchybar/ --- mac/.config/sketchybar/plugins/cpu.sh | 37 +++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 mac/.config/sketchybar/plugins/cpu.sh (limited to 'mac/.config/sketchybar/plugins/cpu.sh') diff --git a/mac/.config/sketchybar/plugins/cpu.sh b/mac/.config/sketchybar/plugins/cpu.sh new file mode 100755 index 0000000..dd55b0a --- /dev/null +++ b/mac/.config/sketchybar/plugins/cpu.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env bash + +# Source colors for consistent theming +source "$CONFIG_DIR/colors.sh" + +# Get CPU usage percentage +CPU_USAGE=$(top -l 1 -n 0 | grep "CPU usage" | awk '{print $3}' | sed 's/%//') + +# Handle empty CPU usage +if [[ -z "$CPU_USAGE" ]]; then + CPU_USAGE=0 +fi + +# Remove decimal point for comparison +CPU_INT=${CPU_USAGE%.*} + +# Set icon and color based on CPU usage +if [[ $CPU_INT -le 25 ]]; then + ICON="󰍛" # Low CPU + COLOR=$ACCENT_SECONDARY # Green +elif [[ $CPU_INT -le 50 ]]; then + ICON="󰍜" # Medium CPU + COLOR=$ACCENT_PRIMARY # Blue +elif [[ $CPU_INT -le 75 ]]; then + ICON="󰍝" # High CPU + COLOR=$ACCENT_TERTIARY # Orange +else + ICON="󰍞" # Very High CPU + COLOR=$RED # Red +fi + +# Update the CPU item +sketchybar --set "$NAME" icon="$ICON" \ + icon.color="$COLOR" \ + label="$CPU_USAGE%" \ + label.color=$WHITE \ + label.font="SF Pro:Medium:12.0" -- cgit v1.2.3