From 48b0de071ededa5592533683ce12c7a74288cb22 Mon Sep 17 00:00:00 2001 From: nevaforget Date: Thu, 9 Apr 2026 11:43:36 +0200 Subject: [PATCH] feat: add brightness slider to Waybar backlight module Wrap backlight in a drawer group with backlight/slider, mirroring the existing sound group pattern. Slider appears on hover/click. --- defaults/xdg/waybar/config | 13 ++++++++++++- defaults/xdg/waybar/style.css | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/defaults/xdg/waybar/config b/defaults/xdg/waybar/config index ba95677..5931100 100644 --- a/defaults/xdg/waybar/config +++ b/defaults/xdg/waybar/config @@ -19,7 +19,7 @@ "mpris", "bluetooth", "group/sound", - "backlight", + "group/brightness", "group/bat", "group/indicators" ], @@ -58,6 +58,17 @@ "transition-left-to-right": true } }, + "group/brightness": { + "orientation": "inherit", + "modules": [ + "backlight", + "backlight/slider" + ], + "drawer": { + "transition-duration": 500, + "transition-left-to-right": true + } + }, "group/bat": { "orientation": "inherit", "modules": [ diff --git a/defaults/xdg/waybar/style.css b/defaults/xdg/waybar/style.css index 255b571..91059f3 100644 --- a/defaults/xdg/waybar/style.css +++ b/defaults/xdg/waybar/style.css @@ -66,6 +66,7 @@ widget widget>* { #sys, #stats, #sound, +#brightness, #indicators { padding: 0 4px; color: alpha(@theme_text_color, 0.5); @@ -114,6 +115,36 @@ widget widget>* { color: #cc3436; } +/* --- Brightness --- */ + +#backlight-slider { + padding-left: 10px; + padding-right: 10px; +} + +#backlight-slider slider { + min-height: 0px; + min-width: 0px; + opacity: 0; + background-image: none; + border: none; + box-shadow: none; + background-color: @insensitive_bg_color; +} + +#backlight-slider trough { + min-height: 4px; + min-width: 80px; + border-radius: 5px; + background-color: alpha(@theme_selected_bg_color, 0.3); +} + +#backlight-slider highlight { + min-width: 5px; + border-radius: 5px; + background-color: alpha(@theme_selected_bg_color, 0.5); +} + /* --- Battery group (hidden when empty, requires Waybar PR #4941) --- */ #bat.empty,