scorpion-26 / gBar

Blazingly fast status bar written with GTK
MIT License
459 stars 17 forks source link

Brightness slider #59

Open CaptaiNiveau opened 9 months ago

CaptaiNiveau commented 9 months ago

Hi!

I've been using this bar for a few months now and been quite happy. Recently I've noticed myself setting the screen brightness manually in the terminal quite often and thought that it'd be nice to integrate it into the bar.

I'd like to contribute to this project and do this myself (I want to learn C++ with that, too). Can you guide me a tad on what I should look out for? I know how to change the brightness on my laptops' integrated screen and my LG TV and would like to abstract that somehow in the config to a reasonable degree.

Do you have discord by chance? Thanks.

scorpion-26 commented 9 months ago

The things you need to add are pretty similar across the different bar components and you can pretty much copy-paste and then adapt them accordingly. Since I'm guessing you want a slider, you can probably look for the implementation(s) of the audio widget. Quick explanation of the parts that need to be modified for new widgets (and some design quirks):

If you also want to add a flyin similar to the audio one (gBar audio 0), you need to modify src/gBar.cpp and add files similar to src/AudioFlyin.[h,cpp]

brightness on my laptops' integrated screen and my LG TV

Beware, that gbar currently only allows one instance of a widget, due to the way gbar is designed.

Regarding discord, can you send me an email with your handle?

CaptaiNiveau commented 9 months ago

Sent the E-Mail.

Yeah I already checked out the repository a bit to fix an issue with the battery widget, which I wanted to PR but you were too fast and fixed it yourself :D

I don't need multiple brightness widgets rn, I was talking about my laptop and desktop separately. For my TV I need to call a CLI to remotely control the TV over LAN, so I have to include an option to call a script with the brightness value and also a script to retrieve it.

I'm a bit annoyed with the way the sliders work, as they shift all the other items around and using my laptops' trackpad it's sometimes a bit annoying to hit the volume slider and get it to 0 (on desktop I can just scroll on it with my mouse). After this I might try to maybe add another style where you open a drop down, probably similar to a lot of other bars. There's also some other ideas I'd like to implement which I'll talk to you on Discord, if you want to.

fdev31 commented 4 months ago

Any update on that?