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

brightness_widget: incorrect brightnessctl command for getting current brightness level #399

Closed
FerrielMelarpis opened this issue Apr 9, 2023 · 1 comment · Fixed by #400

Comments

@FerrielMelarpis
Copy link

Hi there, awesomewm beginner here.
First of, thanks for this awesome project.

Description

When setting the brightness_widget settings to

brightness_widget({
  type = "icon_and_text",
  program = "brightnessctl",
})

the text displayed is not a percentage value but actual brightness value.
In my case it shows 14543 for e.g. and the max brightness value 19393.

Possible solution

To get the actual percentage, I think we can use brightnessctl -m | cut -d, f4 | tr -d %.

Happy to create a PR to fix this and get myself familiar with awesomewm.

@jelleh
Copy link

jelleh commented May 24, 2023

#brightnessctl --version
0.5

#brightnessctl
Device 'intel_backlight' of class 'backlight':
Current brightness: 496 (100%)
Max brightness: 496

#brightnessctl max
496

#brightnessctl get
246

Quick fix

get_brightness_cmd = "bash -c \"brightnessctl -m | awk -F ',' '{print $4+0}'\""

Possible solution
I think you have to calculate the percentage with (brightnessctl get/brightnessctl max)x100

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 a pull request may close this issue.

2 participants