diff --git a/examples/sketchybar/README.md b/examples/sketchybar/README.md new file mode 100644 index 0000000..ce21c66 --- /dev/null +++ b/examples/sketchybar/README.md @@ -0,0 +1,22 @@ +# Sketchybar Integration + +Display pomodoro status in [sketchybar](https://github.com/FelixKratz/SketchyBar). + +## Setup + +1. Copy the plugin to your sketchybar plugins directory: + + ```bash + cp plugins/pomodoro.sh ~/.config/sketchybar/plugins/ + chmod +x ~/.config/sketchybar/plugins/pomodoro.sh + ``` + +2. Update the `POMODORO` path in `pomodoro.sh` to match your installation. + +3. Add the snippet from `sketchybarrc` to your sketchybar configuration. + +4. Reload sketchybar: + + ```bash + sketchybar --reload + ``` diff --git a/examples/sketchybar/plugins/pomodoro.sh b/examples/sketchybar/plugins/pomodoro.sh new file mode 100755 index 0000000..051aba6 --- /dev/null +++ b/examples/sketchybar/plugins/pomodoro.sh @@ -0,0 +1,25 @@ +#!/bin/sh + +POMODORO="$HOME/go/bin/pomodoro" +STATUS=$($POMODORO status 2>/dev/null) + +if [ -z "$STATUS" ]; then + sketchybar --set "$NAME" \ + icon="󰔟" \ + label="00:00" \ + icon.color=0xff9a67ea +else + REMAINING=$($POMODORO status -f "%r" 2>/dev/null) + + if [ "$REMAINING" = "0:00" ]; then + sketchybar --set "$NAME" \ + icon="󰾫" \ + label="Done" \ + icon.color=0xff9a67ea + else + sketchybar --set "$NAME" \ + icon="󱎫" \ + label="$REMAINING" \ + icon.color=0xffff6961 + fi +fi diff --git a/examples/sketchybar/sketchybarrc b/examples/sketchybar/sketchybarrc new file mode 100644 index 0000000..7951b4c --- /dev/null +++ b/examples/sketchybar/sketchybarrc @@ -0,0 +1,9 @@ +PLUGIN_DIR="$CONFIG_DIR/plugins" + +sketchybar --add item pomodoro left \ + --set pomodoro update_freq=1 icon="󰔟" script="$PLUGIN_DIR/pomodoro.sh" label.padding_right=10 icon.padding_left=10 icon.font.size=22 + +sketchybar --add bracket pomodoro \ + --set pomodoro background.color=0xff000000 \ + background.height=30 \ + background.corner_radius=10