wf-shell icon indicating copy to clipboard operation
wf-shell copied to clipboard

Add scroll on battery widget to change screen brightness

Open carterprince opened this issue 2 years ago • 3 comments

Scroll up on the battery widget -> brightness goes up Scroll down on the battery widget -> brightness goes down

I always wanted this in stock GNOME but you have to install a third-party extension to do it.

In the meantime I created a simple patch to do this, but it's not pretty. It relies on brightnessctl.

patch.txt

carterprince avatar Jan 14 '24 06:01 carterprince

I like the behavior of the volume widget. Ideally this would just replicate that but for brightness instead of volume.

carterprince avatar Jan 14 '24 07:01 carterprince

Your patch doesn't seem too bad, maybe make a PR of it? You could check command -v brightnessctl upfront and show a warning if it isn't available, otherwise, hook up the scroll function as you already do currently.

soreau avatar Jan 14 '24 07:01 soreau

Some suggestions:

  • Make the command configurable with options in the cfg file.
  • Call the commands only on discrete scroll events, and if we have 3 steps of discrete scroll, then call the command(s) 3 times.

ammen99 avatar Jan 14 '24 08:01 ammen99