Use the XF86MonBrightnessUp and XF86MonBrightnessDown keys on a new config of COSMIC and see what values the indicator is showing.
Tested both on my config and on the default cosmic config.
Explanation
Let me explain what I mean.
From my usage of the buttons to increase and decrease brightness (XF86MonBrightnessUp and XF86MonBrightnessDown), I think it's fair to assume they're supposed to follow 5% increments i.e pressing the Up button once would increase the brightness by 5%. What ends up happening, however, is that the increments are often not 5%, and I know why.
What the issue is (probably) and how to fix it
From my experience in seeing a similar issue with brightnessctl I think it's fair to assume that the implementation uses a fixed value to go from one brightness value to another, focusing on getting brightness from 0 to 255, likey using a number like 2 or 3 as an approximate percentage increment. What can end up happening, however, is that when the brightness value is incremented, it could correspond to the next percentage rather than the current one (and seeing how often this occurs on going from 0% to 100%, I think it's fair to assume the value 3 is used).
If instead, your implementation focuses on getting to the correct percentage i.e if going from 45% (114.75-117.3, but let's assume 117.1) to 50% (127.5-130.05), you don't just increment the literal value, leading to 51% (132.1). If you used the percentage values instead, and calculated backwards, you would arrive at the correct result. So if you wanted to go from 45% 1 step up, that would be a 5% increase. 45%+5%=50%. 50% of 255 = 50%*255=127.5 and because you're working with the lowest possible value of that percentage, it would be safe to round it up, or if you're using integers, to add 1 to the brightness value, as the range of 1% = 2.55.
Alternative issue and fix
Alternatively, it might be a rounding error, where, as in the above example, 45% (114.75) could be truncated, leaving a result of 44%, or maybe they are rounded up? I'm not sure which it is yet, but I feel the first explanation might be more likely
Thank you
I have no experience with Rust, otherwise I would have done a PR. Thank you for the wonderful desktop! Keep up the good work!
P.S Are there any plans or is there any way to get Static Workspaces in the first release? it's the only thing I want from COSMIC that isn't on the issue board.
Reproduction
Use the XF86MonBrightnessUp and XF86MonBrightnessDown keys on a new config of COSMIC and see what values the indicator is showing. Tested both on my config and on the default cosmic config.
Explanation
Let me explain what I mean.
From my usage of the buttons to increase and decrease brightness (XF86MonBrightnessUp and XF86MonBrightnessDown), I think it's fair to assume they're supposed to follow 5% increments i.e pressing the Up button once would increase the brightness by 5%. What ends up happening, however, is that the increments are often not 5%, and I know why.
What the issue is (probably) and how to fix it
From my experience in seeing a similar issue with
brightnessctl
I think it's fair to assume that the implementation uses a fixed value to go from one brightness value to another, focusing on getting brightness from 0 to 255, likey using a number like 2 or 3 as an approximate percentage increment. What can end up happening, however, is that when the brightness value is incremented, it could correspond to the next percentage rather than the current one (and seeing how often this occurs on going from 0% to 100%, I think it's fair to assume the value 3 is used).If instead, your implementation focuses on getting to the correct percentage i.e if going from 45% (114.75-117.3, but let's assume 117.1) to 50% (127.5-130.05), you don't just increment the literal value, leading to 51% (132.1). If you used the percentage values instead, and calculated backwards, you would arrive at the correct result. So if you wanted to go from 45% 1 step up, that would be a 5% increase. 45%+5%=50%. 50% of 255 = 50%*255=127.5 and because you're working with the lowest possible value of that percentage, it would be safe to round it up, or if you're using integers, to add 1 to the brightness value, as the range of 1% = 2.55.
Alternative issue and fix
Alternatively, it might be a rounding error, where, as in the above example, 45% (114.75) could be truncated, leaving a result of 44%, or maybe they are rounded up? I'm not sure which it is yet, but I feel the first explanation might be more likely
Thank you
I have no experience with Rust, otherwise I would have done a PR. Thank you for the wonderful desktop! Keep up the good work!
P.S Are there any plans or is there any way to get Static Workspaces in the first release? it's the only thing I want from COSMIC that isn't on the issue board.