Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make backlight / alsa bar clickable #2562

Open
Quoteme opened this issue Dec 14, 2021 · 8 comments
Open

Make backlight / alsa bar clickable #2562

Quoteme opened this issue Dec 14, 2021 · 8 comments

Comments

@Quoteme
Copy link

Quoteme commented Dec 14, 2021

Is your feature request related to a problem? Please describe.

I would like the bar from the backlight module to respond to where I click on it. If I click on the left edge of the bar, I would like my backlight to be set to 0%, if I click on the right edge, I would like my backlight at 100% and if I click at the center, I would like my backlight to be at 50%. Same for the volume bar.

Why does polybar need this feature?

This greatly benefits people on a touchscreen monitor.

Describe the solution you'd like

I provided a solution in my first paragraph.

Describe alternatives you've considered

xmobar. I wrote a module for xmobar myself which does exactly that. But xmobar cannot handle my systemtray.

Additional context

@lucax88x
Copy link

And if I may, possibily, allow click-left click-middle click-right like other modules.

@Quoteme
Copy link
Author

Quoteme commented Dec 29, 2021

yeah, maybe it would be a good idea to have some options like click-left-10% = backlight --set 10%, click-left-20% = backlight --set 20% and so on?

@patrick96
Copy link
Member

This has crossed my mind several times already. If anyone wants to work on this feel free :)

It's going to be a bit of a pain to get this into the code because the progressbar code doesn't know anything about click actions and it requires adding an action tag around every segment of the progressbar. In addition this will require new module actions for all modules with clickable progressbars (alsa, pulseaudio, xbacklight, and backlight. mpd also has such an action).

yeah, maybe it would be a good idea to have some options like click-left-10% = backlight --set 10%, click-left-20% = backlight --set 20% and so on?

I don't think that's a good idea. For one, the percentages are not always integers and depend on the size of the progressbar. Also, polybar already has ways to change the properties displayed by the progressbars (scrolling on the modules already does this).

@lucax88x There is already an issue for this #1524

@xoores
Copy link

xoores commented Apr 30, 2022

I added clickable feature in backlight module in #2703 - it toggles between min & max however 50% could be added as a step also...

@Quoteme
Copy link
Author

Quoteme commented May 5, 2022

I added clickable feature in backlight module in #2703 - it toggles between min & max however 50% could be added as a step also...

That definitely is a step in the right direction!

@xoores
Copy link

xoores commented May 5, 2022

It's waiting for merge as #2703 🙂

I might have another (perhaps more elegant) idea for your usesace: I could add left/middle/right click to set 0/50/100% - depending on touchscreen config it might b one/two/three finger tap on the module to set it to the corresponding value. How about that?

@l0f4r0
Copy link

l0f4r0 commented Aug 22, 2023

It's not OP's initial request exactly, but for me, it would be even more enjoyable if any value could be set/recognized depending on where the user has clicked on the bar (not just 3 values like MIN/MED/MAX or deltas like +-10/20/30...).
But it seems complicated to implement according to previous comments...

@xoores
Copy link

xoores commented Oct 23, 2023

I don't think this is easily achievable unfortunately and I don't think this will get merged - my old PR was already in the "toddler" stage and I think it would start walking by now 😆

I'm currently looking for an alternative bar as my old fork randomly freezes and current version has no reverse-scroll option for backlight & volume 😅 I'm also looking into the Wayland (Hyprland + AGS looks sweet!) in the little free time I have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants