A SketchyBar plugin that provides a brightness indicator with slider controls, mimicking the behavior of the volume indicator. Uses the brightness tool for macOS brightness control.
- 🔆 Visual brightness indicator with SF Symbol icons
- 📊 Animated slider showing current brightness level
- ⌨️ F1/F2 keyboard shortcuts for brightness control
- 🖱️ Mouse interaction support (click to set brightness)
- ✨ Smooth animations matching SketchyBar's volume indicator
- 🔄 Real-time slider updates during brightness changes
- SketchyBar - Installation guide
- skhd - Installation guide
- brightness tool - Install from nriley/brightness
# Clone and build the brightness tool
git clone https://github.com/nriley/brightness.git
cd brightness
make
# Move to ~/dev/brightness/ or update paths in the configuration
mkdir -p ~/dev/brightness
cp brightness ~/dev/brightness/
# Clone this repository to ~/dev/
git clone <repository-url> ~/dev/sketchybar-brightness
Add these lines to your ~/.config/sketchybar/icons.sh
file:
# Brightness Icons
export BRIGHTNESS_100=""
export BRIGHTNESS_75=""
export BRIGHTNESS_50=""
export BRIGHTNESS_25=""
export BRIGHTNESS_0=""
Add this line to your ~/.config/sketchybar/sketchybarrc
file:
source "$HOME/dev/sketchybar-brightness/items/brightness.sh"
Add these lines to your ~/.config/skhd/skhdrc
file:
# Brightness controls
f1 : ~/dev/brightness/brightness $(echo "$(~/dev/brightness/brightness -l 2>/dev/null | grep brightness | head -1 | awk -F': ' '{print $2}' | awk '{print $2}') - 0.1" | bc -l | awk '{print ($1 < 0) ? 0 : $1}') && ~/dev/sketchybar-brightness/plugins/brightness_trigger.sh
f2 : ~/dev/brightness/brightness $(echo "$(~/dev/brightness/brightness -l 2>/dev/null | grep brightness | head -1 | awk -F': ' '{print $2}' | awk '{print $2}') + 0.1" | bc -l | awk '{print ($1 > 1) ? 1 : $1}') && ~/dev/sketchybar-brightness/plugins/brightness_trigger.sh
# Restart SketchyBar
brew services restart sketchybar
# Restart skhd
skhd --reload
- F1: Decrease brightness by 10%
- F2: Increase brightness by 10%
- Mouse click on slider: Set brightness to clicked position
- Mouse hover: Show slider knob for precise control
- plugins/brightness.sh: Main plugin handling brightness change events and mouse interactions
- plugins/brightness_trigger.sh: Helper script to read current brightness and trigger SketchyBar updates
- items/brightness.sh: SketchyBar item configuration for the slider and icon components
The integration mimics the volume indicator behavior:
- Slider appears when brightness changes
- Shows current brightness level with appropriate icon
- Updates in real-time during brightness changes
- Automatically hides after 2 seconds of no changes
Modify the icon cases in plugins/brightness.sh
to use different brightness level icons:
case $INFO in
[8-9][0-9]|100) ICON=$BRIGHTNESS_100 ;;
[6-7][0-9]) ICON=$BRIGHTNESS_75 ;;
[3-5][0-9]) ICON=$BRIGHTNESS_50 ;;
[1-2][0-9]) ICON=$BRIGHTNESS_25 ;;
0) ICON=$BRIGHTNESS_0 ;;
*) ICON=$BRIGHTNESS_100 ;;
esac
Modify the slider styling in items/brightness.sh
:
brightness_slider=(
slider.highlight_color=$BLUE
slider.background.height=5
slider.background.corner_radius=3
slider.background.color=$BACKGROUND_2
# ... other styling options
)
Change the key bindings in your skhdrc
file to use different keys or modifiers.
Ensure the brightness tool is installed and the path in the skhd configuration matches your installation location.
- Check that SketchyBar is running:
brew services list | grep sketchybar
- Verify the brightness item is loaded in your SketchyBar configuration
- Test manually:
~/dev/sketchybar-brightness/plugins/brightness_trigger.sh
- Check that skhd is running:
ps aux | grep skhd
- Reload skhd configuration:
skhd --reload
- Verify the brightness tool path in your skhd configuration
The brightness tool works with built-in displays. For external displays, you may need to modify the brightness parsing logic in brightness_trigger.sh
.
MIT License - feel free to modify and distribute.
- SketchyBar by FelixKratz
- brightness tool by Nicholas Riley
- skhd by koekeishiya