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

Added a widget to control brightness with light command #205

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

ronniedroid
Copy link

light is a good program to get brightness states of many devices and also control them, once can use this same module to control the keyboard brightness, for example, by changing the device.

I based my widget on your alsavolumecontrol.py

Please let me know if I should change something.

one other thing, while the ALSAWidget updates instantly, this one takes a sec to update, maybe you will know why :-) as I am not a python programmer (My first project)

anyway, I hope you will like it.

@elParaguayo
Copy link
Owner

Hey @ronniedroid - thanks for submitting this.

I'll take a look over this when I can.

@elParaguayo
Copy link
Owner

elParaguayo commented Nov 27, 2022

The problem I have with this is that I'm not sure what it really adds over the existing widget.

You can control other lights (e.g. keyboard LEDs) with the existing widget too by changing the device path.

What am I missing?

On a related note, I wonder if your delay comes from the calls to light.

@ronniedroid
Copy link
Author

Well, light is much easier to use and does not require setting udev rules, and it also works with Wayland as it is not dependent on xorg. I have always had an easier way setting up light than other brightness tools.

I also thought so, but light is actually pretty fast.

↪ time light -G -s sysfs/backlight/intel_backlight
39.66
________________________________________________________
Executed in    4.13 millis    fish           external
  usr time    0.00 millis  0.00 micros    0.00 millis
  sys time    4.13 millis  849.00 micros  3.28 millis

@elParaguayo
Copy link
Owner

Well, light is much easier to use and does not require setting udev rules

Yes. That's the bit I don't like about the current widget but I'm curious how light is doing it as I would assume it's writing to the same device. I need to look into this a bit more.

and it also works with Wayland as it is not dependent on xorg.

The current widget should work on both. Does it not?

@elParaguayo
Copy link
Owner

From what I can tell, light installs with elevated privileges. This isn't ideal so they added an option to install udev rules just like the ones with the existing widget. So the advantage here is that light is installing the udev rule rather than you having to do it yourself.

I don't know if that's enough of a reason to have a new widget.

@ronniedroid
Copy link
Author

ronniedroid commented Nov 27, 2022

What about having it as an option for people who would prefer/will have a better luck with light?

@ronniedroid
Copy link
Author

I switched to drawing the Icon with cairo, it is not too fancy, Just a circle which gets empty and full based on brightness level, and the fill and border color can be changed for four levels of brightness. if anyone knows cairo better than me and can make it fancier, please do so.

I think having this color changing icon (plus the bar) adds enough difference from the already included brightness widget too, what do you think?

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

Successfully merging this pull request may close these issues.

2 participants