summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar/items/brew.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/items/brew.sh
init
Diffstat (limited to 'mac/.config/sketchybar/items/brew.sh')
-rw-r--r--mac/.config/sketchybar/items/brew.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/mac/.config/sketchybar/items/brew.sh b/mac/.config/sketchybar/items/brew.sh
new file mode 100644
index 0000000..4e58efd
--- /dev/null
+++ b/mac/.config/sketchybar/items/brew.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+# Trigger the brew_udpate event when brew update or upgrade is run from cmdline
+# e.g. via function in .zshrc or fish function
+
+POPUP_CLICK_SCRIPT="sketchybar --set $NAME popup.drawing=toggle"
+
+brew=(
+ script="$PLUGIN_DIR/brew.sh"
+ click_script="$POPUP_CLICK_SCRIPT"
+ icon=􀐛
+ label=?
+ update_freq=30
+ popup.align=right
+ popup.height=20
+ icon.padding_right=-1
+ padding_left=0
+ padding_right=-1
+ y_offset=1
+)
+
+brew_details=(
+ background.corner_radius=12
+ background.padding_left=5
+ background.padding_right=10
+ click_script="sketchybar --set brew popup.drawing=off"
+)
+
+sketchybar --add event brew_update \
+ --add item brew right \
+ --set brew "${brew[@]}" \
+ \
+ --subscribe brew brew_update \
+ mouse.entered \
+ mouse.exited \
+ mouse.exited.global \
+ \
+ --add item brew.details popup.brew \
+ --set brew.details "${brew_details[@]}"