Robust brightness control for external monitors using DDC/CI on Hyprland with Waybar integration and Omarchy menu support.
curl -sL https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/install.sh | bashThe installer will auto-detect your I2C buses, download all scripts, configure Hyprland keybindings and autostart, set up the Omarchy menu extension, and check i2c group permissions.
- Multi-monitor sync - Both monitors always stay at the same brightness level
- Fast and responsive - Debounced hardware writes (150ms), instant UI feedback via cached state
- Waybar integration - Visual indicator with scroll-to-adjust and percentage display
- Interactive TUI menu - Click for detailed control with presets
- Omarchy menu integration - Brightness option in Setup menu via extensions
- Keyboard shortcuts - Standard brightness keys + Alt+F1/F2 alternatives
- Race-condition safe - Global flock for rapid key presses
- OSD notifications - SwayOSD overlay on brightness changes
- Startup init - Automatically caches hardware brightness on login
pacman -S ddcutil jq swayosdYour monitors must support DDC/CI (most modern monitors do). Run ddcutil detect to verify.
| File | Location | Purpose |
|---|---|---|
brightness |
~/bin/brightness |
Main brightness control script |
monitor-brightness |
~/bin/monitor-brightness |
Simple per-monitor brightness (legacy/utility) |
brightness.sh |
~/.config/waybar/scripts/ |
Waybar status indicator |
brightness-menu.sh |
~/.config/waybar/scripts/ |
Interactive TUI brightness menu |
init-brightness.sh |
~/.config/hypr/scripts/ |
Startup brightness cache init |
omarchy-menu-extension.sh |
~/.config/omarchy/extensions/menu.sh |
Omarchy menu brightness entry |
mkdir -p ~/bin
curl -o ~/bin/brightness https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/brightness
chmod +x ~/bin/brightness
# Edit BUS_1 and BUS_2 to match your I2C buses
# Run `ddcutil detect` to find your bus numberscurl -o ~/bin/monitor-brightness https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/monitor-brightness
chmod +x ~/bin/monitor-brightnessmkdir -p ~/.config/waybar/scripts
curl -o ~/.config/waybar/scripts/brightness.sh https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/brightness.sh
curl -o ~/.config/waybar/scripts/brightness-menu.sh https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/brightness-menu.sh
chmod +x ~/.config/waybar/scripts/brightness.sh
chmod +x ~/.config/waybar/scripts/brightness-menu.shmkdir -p ~/.config/hypr/scripts
curl -o ~/.config/hypr/scripts/init-brightness.sh https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/init-brightness.sh
chmod +x ~/.config/hypr/scripts/init-brightness.shAdd to ~/.config/hypr/autostart.conf:
# Initialize monitor brightness cache
exec-once = ~/.config/hypr/scripts/init-brightness.sh
Add to ~/.config/waybar/config.jsonc in modules-right:
Add to ~/.config/waybar/style.css:
#custom-brightness {
font-size: 12px;
margin: 0 8px;
padding: 0 4px;
}
#custom-brightness:hover {
background-color: rgba(255, 255, 255, 0.1);
border-radius: 3px;
}Then restart Waybar: omarchy-restart-waybar
Add to ~/.config/hypr/bindings.conf:
# Unbind default Omarchy brightness bindings (for laptop backlight)
unbind = , XF86MonBrightnessUp
unbind = , XF86MonBrightnessDown
unbind = ALT, XF86MonBrightnessUp
unbind = ALT, XF86MonBrightnessDown
# Bind to our DDC monitor brightness control (ALL monitors)
bindel = , XF86MonBrightnessUp, exec, ~/bin/brightness up-all
bindel = , XF86MonBrightnessDown, exec, ~/bin/brightness down-all
# Alt+F1/F2 alternative bindings (ALL monitors)
bindel = ALT, F2, exec, ~/bin/brightness up-all
bindel = ALT, F1, exec, ~/bin/brightness down-all
To add a Brightness entry to the Omarchy Setup menu:
mkdir -p ~/.config/omarchy/extensions
curl -o ~/.config/omarchy/extensions/menu.sh https://gist.githubusercontent.com/andrescera/d82b815d3ce7eed0feeb7b18f0c4d25e/raw/omarchy-menu-extension.shThis adds a Brightness option under Omarchy Menu > Setup that opens the interactive TUI.
brightness up # Increase all monitors by 10%
brightness up-all # Same as above (alias)
brightness down # Decrease all monitors by 10%
brightness down-all # Same as above (alias)
brightness set 50 # Set all monitors to 50%
brightness set-all 50 # Same as above (alias)
brightness status # Show state + hardware values for all monitors
brightness init # Read hardware and cache current brightness
brightness sync # Sync both monitors to cached valueWaybar: Scroll to adjust, click to open the interactive menu.
The main brightness script uses hardcoded I2C bus numbers for speed. Find yours with:
ddcutil detectThen update BUS_1 and BUS_2 at the top of ~/bin/brightness.
The brightness.sh waybar script uses a monitor map for state file lookups. Update the monitors associative array if your monitor names differ:
local -A monitors=(["DP-2"]="1" ["DP-3"]="2")# Monitors not detected
ddcutil detect
# Permission issues
sudo usermod -aG i2c $USER
# Then log out and back in
# State out of sync with hardware
brightness sync
# Clear all cached state
rm -rf /run/user/$(id -u)/brightness/
# Check current hardware values directly
ddcutil --bus 4 getvcp 10
ddcutil --bus 5 getvcp 10MIT