From 119789cc53e04ab7d018d9de6b5b14f01881101c Mon Sep 17 00:00:00 2001 From: "s0wlz (Matthias Puchstein)" Date: Mon, 1 Jun 2026 14:05:35 +0200 Subject: [PATCH] hypr: use a single brightnessctl call for the brightness OSD brightnessctl -m s sets and prints the new percentage in one invocation, so drop the second brightnessctl call per (repeating) brightness keypress. --- dot_config/hypr/hyprland.d.lua/keybinds.lua.tmpl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dot_config/hypr/hyprland.d.lua/keybinds.lua.tmpl b/dot_config/hypr/hyprland.d.lua/keybinds.lua.tmpl index c52ebc7..e6f757c 100644 --- a/dot_config/hypr/hyprland.d.lua/keybinds.lua.tmpl +++ b/dot_config/hypr/hyprland.d.lua/keybinds.lua.tmpl @@ -377,9 +377,10 @@ hl.bind("XF86AudioPrev", hl.dsp.exec_cmd("playerctl previous"), { locked = tr -- Brightness — let brightnessctl do the math, then push the new percentage to -- the Quickshell OSD (field 4 of `-m` output is the percentage, e.g. "70%"). local function brightness_step(arg) + -- Single brightnessctl call: `-m s` sets and prints the machine line + -- (device,class,current,percent,max); field 4 is the new percentage. return hl.dsp.exec_cmd( - "brightnessctl -e4 -n2 s " .. arg .. - " >/dev/null && qs ipc call osd brightness \"$(brightnessctl -m | cut -d, -f4 | tr -d %)\"" + "qs ipc call osd brightness \"$(brightnessctl -e4 -n2 -m s " .. arg .. " | cut -d, -f4 | tr -d %)\"" ) end hl.bind("XF86MonBrightnessUp", brightness_step("1%+"), { locked = true, repeating = true, description = "Brightness up (1%)" })