Brightness & colour temperature control for desktop PCs
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Hi, B.K.
Mm. It's not what you think, actually! Those numbers are the Kelvin scale, where 0 degrees K represents -273C (absolute zero; the point at which any & all molecular & atomic movement completely ceases.)
Moreover, the numbers are not representing an actual temperature, even so. It's a bit too complicated for me, but it's something to do with 'black-body radiation'? Summat to do with a body that perfectly absorbs all radiation.....and the theoretical temperature it would have to attain in order to glow at those particular 'colors' on the Kelvin scale.
Perhaps this might help dispel some of the mystery...
(Don't say I didn't warn you! My head's spinning already.....)
I couldn't give a hoot about the 'whys' and 'wherefores', as long as it works, mate!
Mike.
Mm. It's not what you think, actually! Those numbers are the Kelvin scale, where 0 degrees K represents -273C (absolute zero; the point at which any & all molecular & atomic movement completely ceases.)
Moreover, the numbers are not representing an actual temperature, even so. It's a bit too complicated for me, but it's something to do with 'black-body radiation'? Summat to do with a body that perfectly absorbs all radiation.....and the theoretical temperature it would have to attain in order to glow at those particular 'colors' on the Kelvin scale.
Perhaps this might help dispel some of the mystery...
(Don't say I didn't warn you! My head's spinning already.....)
I couldn't give a hoot about the 'whys' and 'wherefores', as long as it works, mate!
Mike.
Last edited by Mike Walsh on Mon 17 Sep 2018, 18:29, edited 2 times in total.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Fred:-
I've got the dual-slider utility working fine in most modern Pups by installing redshift via the PPM. For a lot of the older 5-series Pups (570, 560, 571, Raring, Racy, etc.,) I've used a redshift binary of version 1.8 that I sourced from the Slackware repos via pkgs.org. It doesn't seem to need the addition of anything else; it complains about wanting libgeoclue if you 'start' it from the terminal, but to all intents & purposes it functions fine for our needs here.
I have found one small peculiarity.....namely, that when I set it down to my usual 3600, it's actually far more red than I would normally expect. So, I've settled on around 4700-4800 as a comfortable night-time level instead. Which suggests to me that Bob might perhaps be right about it appearing to manipulate the gamma ramp somewhat differently when used this way? Aside from that, it works perfectly;I'm very happy with it.
(It's partly why I upped the lower limit from 2000/2400 up to around 3500 in the .pet.....at that point, it's already extremely 'red' in hue; I figured other folks might in all likelihood discover the same 'problem'...)
I think you've 'cracked it', Fred. Well done, mate. And grateful thanks from someone to whom this is still so much 'Greek'.....
Do we think (like bigpup) that this is now worthy of being included in Woof-CE.....for future Pups?
I'm going to give this a try on ye olde Dell lappie tonight firstly in Slacko 570 (my main driver on there); and then in Xenial 7.0.8.1, which she currently dual-boots with. I may have problems, though; I have to use the
...kernel-line workaround, due to the 'orrible Intel graphics adapter the old girl's saddled with (it's one of those 'Brookedale' thingamajigs; still gives a brilliant picture, but needs 'coaxing' under Linux to give of its best).
I shall report back, as & when. Redshift's never really worked correctly on there, except for when I had Lucid installed breifly. If only the brightness slider works, I shall be well chuffed.
Mike.
I've got the dual-slider utility working fine in most modern Pups by installing redshift via the PPM. For a lot of the older 5-series Pups (570, 560, 571, Raring, Racy, etc.,) I've used a redshift binary of version 1.8 that I sourced from the Slackware repos via pkgs.org. It doesn't seem to need the addition of anything else; it complains about wanting libgeoclue if you 'start' it from the terminal, but to all intents & purposes it functions fine for our needs here.
I have found one small peculiarity.....namely, that when I set it down to my usual 3600, it's actually far more red than I would normally expect. So, I've settled on around 4700-4800 as a comfortable night-time level instead. Which suggests to me that Bob might perhaps be right about it appearing to manipulate the gamma ramp somewhat differently when used this way? Aside from that, it works perfectly;I'm very happy with it.
(It's partly why I upped the lower limit from 2000/2400 up to around 3500 in the .pet.....at that point, it's already extremely 'red' in hue; I figured other folks might in all likelihood discover the same 'problem'...)
I think you've 'cracked it', Fred. Well done, mate. And grateful thanks from someone to whom this is still so much 'Greek'.....
Do we think (like bigpup) that this is now worthy of being included in Woof-CE.....for future Pups?
I'm going to give this a try on ye olde Dell lappie tonight firstly in Slacko 570 (my main driver on there); and then in Xenial 7.0.8.1, which she currently dual-boots with. I may have problems, though; I have to use the
Code: Select all
i915.modeset=0
I shall report back, as & when. Redshift's never really worked correctly on there, except for when I had Lucid installed breifly. If only the brightness slider works, I shall be well chuffed.
Mike.
Last edited by Mike Walsh on Mon 17 Sep 2018, 21:18, edited 1 time in total.
-
- Posts: 807
- Joined: Mon 12 Oct 2009, 17:11
Thanks for the lesson Mike.
Hope the head spinning it caused will go away quickly.
Hope the head spinning it caused will go away quickly.
[color=blue]B.K. Johnson
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
tahrpup-6.0.5 PAE (upgraded from 6.0 =>6.0.2=>6.0.3=>6.0.5 via quickpet/PPM=Not installed); slacko-5.7 occasionally. Frugal install, pupsave file, multi OS flashdrive, FAT32 , SYSLINUX boot, CPU-Dual E2140, 4GB RAM[/color]
Hi Mike,
The reason I shared the redshift SFS in above post is because I've found that installing redshift from PPM in Tahr does also install redshift-gtk, which is taking more space than needed.
Install from PPM in Slacko is ok, installs redshift only.
(didn't test on more puppies)
The SFS contains older redshift version (I believe 1.7), is very small, hasn't got "geoclue" included, but should work well for the purpose of this project.
Fred
Ok,..., it's a matter of taste of course (and probably different for each monitor), but for me the value 3000 (or a bit less) is the most comfortable at night time (BTW, at day time I prefer some color dimming also, set it to 4500), but below 2500 it gives for me a more yellow-like view which I don't like.I have found one small peculiarity.....namely, that when I set it down to my usual 3600, it's actually far more red than I would normally expect. So, I've settled on around 4700-4800 as a comfortable night-time level instead.
The reason I shared the redshift SFS in above post is because I've found that installing redshift from PPM in Tahr does also install redshift-gtk, which is taking more space than needed.
Install from PPM in Slacko is ok, installs redshift only.
(didn't test on more puppies)
The SFS contains older redshift version (I believe 1.7), is very small, hasn't got "geoclue" included, but should work well for the purpose of this project.
Fred
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Completely as expected. None of the brightness controls work on the old Dell at all. The 1100 won't have it. Software 'controls' are a no-go, as far as it's concerned.
Xrandr doesn't. The Redshift-based one doesn't. And (despite this being a lappie.....and an Intel one at that!), there is still nothing in /sys/class/backlight for Johny's version to work with.
It does, however (and I'd totally forgotten this) have a hardware brightness control.....operated directly via two 'Fn'-activated keys on the keyboard. So, not a complete loss after all.
Curiously, though, the rather newer Dell 15R that I inherited from Mama does indeed have entries in /sys/class/backlight.....so I may try Johny's version on there, and see what happens. True to form (it also being a Dell), it too has hardware brightness controls. Perhaps this is standard on Dells; I can't say, having only had experience with relatively few machines.
My boxes are all dead reliable, y'know....
----------------------------------
I'm guessing you're right about settings, responses, behaviour, etc., varying from one screen to another. All I can say is that a night-time setting of 3600 as presented by RedshiftGUI is not the same as 3600 as presented by what we've achieved here. Not that I'm complaining, mind; in all honesty, I couldn't care less what the exact values are.....because it's variable as & when required, with instant access.
And that's what I was really after. The 'instant access' bit.....as and when required. If anything, it's probably more necessary on a desktop than a laptop, because many laptops do have direct brightness controls, from what I can gather.
Desktops have 'em on the monitor itself.....but mine,at least, are a bit of a pain to operate. I wanted something that was easily accessible (in the tray), and easy to use. This all fits the bill nicely.....and if other folks benefit from this little project, so much the better.
Mike.
Xrandr doesn't. The Redshift-based one doesn't. And (despite this being a lappie.....and an Intel one at that!), there is still nothing in /sys/class/backlight for Johny's version to work with.
It does, however (and I'd totally forgotten this) have a hardware brightness control.....operated directly via two 'Fn'-activated keys on the keyboard. So, not a complete loss after all.
Curiously, though, the rather newer Dell 15R that I inherited from Mama does indeed have entries in /sys/class/backlight.....so I may try Johny's version on there, and see what happens. True to form (it also being a Dell), it too has hardware brightness controls. Perhaps this is standard on Dells; I can't say, having only had experience with relatively few machines.
My boxes are all dead reliable, y'know....
----------------------------------
I'm guessing you're right about settings, responses, behaviour, etc., varying from one screen to another. All I can say is that a night-time setting of 3600 as presented by RedshiftGUI is not the same as 3600 as presented by what we've achieved here. Not that I'm complaining, mind; in all honesty, I couldn't care less what the exact values are.....because it's variable as & when required, with instant access.
And that's what I was really after. The 'instant access' bit.....as and when required. If anything, it's probably more necessary on a desktop than a laptop, because many laptops do have direct brightness controls, from what I can gather.
Desktops have 'em on the monitor itself.....but mine,at least, are a bit of a pain to operate. I wanted something that was easily accessible (in the tray), and easy to use. This all fits the bill nicely.....and if other folks benefit from this little project, so much the better.
Mike.
Apologize for the late reply... doggone real life keeps interrupting the real fun!
@ Fred; Indeed, the Yad version in my earlier reported Ubuntu Mate issue is...
... and your...
...does the trick!
Minor question/quibble - is there a reason/need for the (hidden?) re-size handle/border running horizontally through the center of the Yad window (pic attached)? Sometimes seems to make the cursor act a little strange, trying to decide between pointer and "grab border" (I've been meaning to look into the script to see where that "border" is defined, but haven't had a chance! )...
@Mike; Definitely keep both .pets available (!!), as I recall having issue in finding Redshift on a Pup some while ago (can't remember which...) - and it's always nice having options anyway. I too agree in the usefulness with stand-alone monitors, with their typically fiddly physical button/menu settings access. But also very useful on the odd laptop where the brightness buttons don't function. And especially useful on later-model, lower-tier LED backlit laptop screens - which seem universally & annoyingly cold/bluish at the standard 6500K setting. A "must have" for those buggers!!
Thanks much, fellas...
Bob
@ Fred; Indeed, the Yad version in my earlier reported Ubuntu Mate issue is...
Code: Select all
yad --version
0.38.2 (GTK+ 3.22.30)
Code: Select all
--width=450 --height=300
...does the trick!
Minor question/quibble - is there a reason/need for the (hidden?) re-size handle/border running horizontally through the center of the Yad window (pic attached)? Sometimes seems to make the cursor act a little strange, trying to decide between pointer and "grab border" (I've been meaning to look into the script to see where that "border" is defined, but haven't had a chance! )...
@Mike; Definitely keep both .pets available (!!), as I recall having issue in finding Redshift on a Pup some while ago (can't remember which...) - and it's always nice having options anyway. I too agree in the usefulness with stand-alone monitors, with their typically fiddly physical button/menu settings access. But also very useful on the odd laptop where the brightness buttons don't function. And especially useful on later-model, lower-tier LED backlit laptop screens - which seem universally & annoyingly cold/bluish at the standard 6500K setting. A "must have" for those buggers!!
Thanks much, fellas...
Bob
- Attachments
-
- ScreenControl_redshift-v1.4-noarch.jpg
- On Peebee's Upup Bionic...
- (18.06 KiB) Downloaded 466 times
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Hiya, Bob.
I shall definitely leave the SCT version available; my motto, as you know, is 'choice in all things' as far as our community is concerned. I don't care if there are 50 ways available to do something. Choice is a good thing.
Personally, I don't find the 'handle' gets in the way.....but then, that's just me! And, using Ziggy's 'Stardust' GTK theme as I do, it doesn't appear to be as close to the top slider as yours does...
(*shrug*)
Mike.
I shall definitely leave the SCT version available; my motto, as you know, is 'choice in all things' as far as our community is concerned. I don't care if there are 50 ways available to do something. Choice is a good thing.
AFAIK (and I'm far from being expert with YAD yet), that 'handle' is a by-product of using the '--paned' option to get two sliders functioning in the same GUI. rg66 did provide an example for doing this another way, but it seems that for our use-case here, that method doesn't function the way we need it to.Moat wrote:Minor question/quibble - is there a reason/need for the (hidden?) re-size handle/border running horizontally through the center of the Yad window (pic attached)? Sometimes seems to make the cursor act a little strange, trying to decide between pointer and "grab border" (I've been meaning to look into the script to see where that "border" is defined, but haven't had a chance! )...
Personally, I don't find the 'handle' gets in the way.....but then, that's just me! And, using Ziggy's 'Stardust' GTK theme as I do, it doesn't appear to be as close to the top slider as yours does...
(*shrug*)
Mike.
Hi ya, Mike!
Just wanted to say "thank you" to you (and Fred/Mochi/all) for working on this.
Along with many other pups & ddogs in my frgual-drives stable, I like to use Barry's latest Easy OS (playing with the Containers is great). But Barry's latest Easy (and Quirkly, oddly) version for some reason would no longer let redshift-cli and/or redshiftgui function from PPM and/or Fred's great redshiftgui creations. Really weird and above my paygrade to understand why, when in all previous versions of Easy (and Quirky) all sorts of redshift & redshiftgui worked.
Anyhow, the SCT you found & re-worked & [packaged up for us works a charm.
Mucho gracias for working on this.
I want to echo Moat---SCT is so small and useful that we need to lobby to get SCT into all woof-CE builds. Who do we need to convince at woof-CE to make this happen?? It's hard to underestimate how many puppy users (both new & old) don't understand that there is indeed an alternative to having to stare at these bright screens nowadays & fry what remaining brain cells we've entered into older (cough, cough) age with.
Fred includes redshiftgui by default in his creations, and everyone I've shown OSes stuff too, from family to friends and neighbors, they all---when seeing the redshiftgui and its ease of function from the tray---all let out this audible sigh of pleasure. Sometimes, by itself the redshiftgui seals the deal for them & they become a ddog convert/user.
Pups would experience this too if woof-CE would just wake up to this, something I've been banging on them about for over 2-3 years now. I thought when I convinced Micko to compile and put redshfitgui in his last Slack0 700 creation that it would thus become a standard part of woof-CE.
But, no such luck
So, at the least, there is no reason your SCT here shouldn't be mandatorily included in all woof-CE builds----it's too flippin' small and also incredbily useful not to be included.
Just wanted to say "thank you" to you (and Fred/Mochi/all) for working on this.
Along with many other pups & ddogs in my frgual-drives stable, I like to use Barry's latest Easy OS (playing with the Containers is great). But Barry's latest Easy (and Quirkly, oddly) version for some reason would no longer let redshift-cli and/or redshiftgui function from PPM and/or Fred's great redshiftgui creations. Really weird and above my paygrade to understand why, when in all previous versions of Easy (and Quirky) all sorts of redshift & redshiftgui worked.
Anyhow, the SCT you found & re-worked & [packaged up for us works a charm.
Mucho gracias for working on this.
I want to echo Moat---SCT is so small and useful that we need to lobby to get SCT into all woof-CE builds. Who do we need to convince at woof-CE to make this happen?? It's hard to underestimate how many puppy users (both new & old) don't understand that there is indeed an alternative to having to stare at these bright screens nowadays & fry what remaining brain cells we've entered into older (cough, cough) age with.
Fred includes redshiftgui by default in his creations, and everyone I've shown OSes stuff too, from family to friends and neighbors, they all---when seeing the redshiftgui and its ease of function from the tray---all let out this audible sigh of pleasure. Sometimes, by itself the redshiftgui seals the deal for them & they become a ddog convert/user.
Pups would experience this too if woof-CE would just wake up to this, something I've been banging on them about for over 2-3 years now. I thought when I convinced Micko to compile and put redshfitgui in his last Slack0 700 creation that it would thus become a standard part of woof-CE.
But, no such luck
So, at the least, there is no reason your SCT here shouldn't be mandatorily included in all woof-CE builds----it's too flippin' small and also incredbily useful not to be included.
Brightness & colour temperature control for desktop PCs
Hi,belham2 wrote: Along with many other pups & ddogs in my frgual-drives stable, I like to use Barry's latest Easy OS (playing with the Containers is great). But Barry's latest Easy (and Quirkly, oddly) version for some reason would no longer let redshift-cli and/or redshiftgui function from PPM and/or Fred's great redshiftgui creations. Really weird and above my paygrade to understand why, when in all previous versions of Easy (and Quirky) all sorts of redshift & redshiftgui worked.
In Quirky 8.7.1 beaver64 I installed redshift-1.11-x86_64.pet downloaded Fred's rshift-portable-64-bit.tar.gz and put rshift-portable-64 in /root/Startup
EDIT: the pet isn't needed so I deleted it, thanks Fred.
- Attachments
-
- tray.jpg
- (6.64 KiB) Downloaded 386 times
Last edited by Billtoo on Fri 05 Oct 2018, 14:56, edited 1 time in total.
Re: Brightness & colour temperature control for desktop PCs
Same for me on Quirky 8.7.1 beaver64, works well, btw, the portable does include redshift already, so no need to install redshift .pet or from PPM.Billtoo wrote:Hi,belham2 wrote: Along with many other pups & ddogs in my frgual-drives stable, I like to use Barry's latest Easy OS (playing with the Containers is great). But Barry's latest Easy (and Quirkly, oddly) version for some reason would no longer let redshift-cli and/or redshiftgui function from PPM and/or Fred's great redshiftgui creations. Really weird and above my paygrade to understand why, when in all previous versions of Easy (and Quirky) all sorts of redshift & redshiftgui worked.
In Quirky 8.7.1 beaver64 I installed redshift-1.11-x86_64.pet downloaded Fred's rshift-portable-64-bit.tar.gz and put rshift-portable-64 in /root/Startup
Also I tested on EasyOs Beaver 64, and redshift works OK (as command line utility and also running rshift-portable-64)
What exactly doesn't work for you Belham ? Did you try to run from terminal , any errors ?
Fred
Hi Fred & Billtoo,
Well, I finally got redshift-cli working in latest Easy.
I tried numerous times and couldn't even get any of the redshifts I have (have got all of yours, Fred)....same thing was happening with Beaver. But, suddenly, installing MikeWalsh's stuff got redshift-cli working. Doing it from PPM or from a pet install (or manually dropping stuff in their respective folders like I am used to doing) wouldn't work.
Anyhow, I am giving up Quirky Beaver since Barry is stopping work on it, so that's no biggie. But it was really bugging in Easy......I am fairly proficient at getting this too work (once you give me what needs to go in /usr/bin) and/or figuring out why/where it isn't working after that.
But it was stumping me.......and I tried both full installs of Easy and frugal installs (a little more difficult to do with Barry's Easy stuff) to USB.
Anyhow, redshift-cli with SCT is working now, and everything is great.
Now if I just figure out how Barry got Seamonky to have audio while in a Container yet I cannot get Firefox to have audio, then all will be right with the Easy world
Thanks again guys.
Well, I finally got redshift-cli working in latest Easy.
I tried numerous times and couldn't even get any of the redshifts I have (have got all of yours, Fred)....same thing was happening with Beaver. But, suddenly, installing MikeWalsh's stuff got redshift-cli working. Doing it from PPM or from a pet install (or manually dropping stuff in their respective folders like I am used to doing) wouldn't work.
Anyhow, I am giving up Quirky Beaver since Barry is stopping work on it, so that's no biggie. But it was really bugging in Easy......I am fairly proficient at getting this too work (once you give me what needs to go in /usr/bin) and/or figuring out why/where it isn't working after that.
But it was stumping me.......and I tried both full installs of Easy and frugal installs (a little more difficult to do with Barry's Easy stuff) to USB.
Anyhow, redshift-cli with SCT is working now, and everything is great.
Now if I just figure out how Barry got Seamonky to have audio while in a Container yet I cannot get Firefox to have audio, then all will be right with the Easy world
Thanks again guys.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
@ belham2:-
I'm just pleased someone's finding it useful, mate.
The only part of this I can lay claim to is the original idea (that of making this work for desktops). And even that was inspired by johnywhy's thread..!
(Oh, perhaps compiling the SCT binary we used here. Maybe.)
I played around with YAD a bit, to see what I could come up with.....and then had to ask for assistance. The important stuff (the code) that makes it work, that was all Fred's doing. Really & truly, this was Fred's baby, in that respect....not mine at all.
So Fred should get the credit, not me. I refuse to take credit for the work of others; it's not on. In the end, I don't care who gets credit, if I'm honest; if I play even a small part in getting something up-and-running that'll benefit the whole Puppy community, I'm cool with that.
Original idea by johnywhy.
SCT discovered by labbe5.
Coding performed by Fred.
So, as you can see, I had very little to do with this at all.....
I just want our community to be something to be proud of, regardless of the endless bickering and 'in-fighting' that seems embedded within certain camps.....and to have plenty of choice when it comes to useful packages/utilities for our favourite wee OS. Perhaps I'm viewing the whole shebang thru' 'rose-tinted specs'; that's just me, I guess. If others have half as much fun with their Puppy boxes as I've had this last 4 years or so.....then it's all good, as far as I'm concerned.
Perhaps I'm just altruistic..!
Mike.
I'm just pleased someone's finding it useful, mate.
The only part of this I can lay claim to is the original idea (that of making this work for desktops). And even that was inspired by johnywhy's thread..!
(Oh, perhaps compiling the SCT binary we used here. Maybe.)
I played around with YAD a bit, to see what I could come up with.....and then had to ask for assistance. The important stuff (the code) that makes it work, that was all Fred's doing. Really & truly, this was Fred's baby, in that respect....not mine at all.
So Fred should get the credit, not me. I refuse to take credit for the work of others; it's not on. In the end, I don't care who gets credit, if I'm honest; if I play even a small part in getting something up-and-running that'll benefit the whole Puppy community, I'm cool with that.
Original idea by johnywhy.
SCT discovered by labbe5.
Coding performed by Fred.
So, as you can see, I had very little to do with this at all.....
I just want our community to be something to be proud of, regardless of the endless bickering and 'in-fighting' that seems embedded within certain camps.....and to have plenty of choice when it comes to useful packages/utilities for our favourite wee OS. Perhaps I'm viewing the whole shebang thru' 'rose-tinted specs'; that's just me, I guess. If others have half as much fun with their Puppy boxes as I've had this last 4 years or so.....then it's all good, as far as I'm concerned.
Perhaps I'm just altruistic..!
Mike.
Small changes
Hi,
I made some small changes on the Brightness_control package
1. Restarting X does not reset the Brightness value
2. Smaller size control, no buttons
3. New tray icon pops up / closes the control
Downloadable from http://www.smokey01.com/gjuhasz/packages.
Have fun!
Regards,
gjuhasz
I made some small changes on the Brightness_control package
1. Restarting X does not reset the Brightness value
2. Smaller size control, no buttons
3. New tray icon pops up / closes the control
Downloadable from http://www.smokey01.com/gjuhasz/packages.
Have fun!
Regards,
gjuhasz
- Attachments
-
- Brightness_control.jpg
- (8.9 KiB) Downloaded 285 times
Last edited by gjuhasz on Sun 07 Oct 2018, 22:37, edited 1 time in total.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
Hi, gjuhasz.
Thanks for that, mate.
The only reason I made the 'control' itself as big as I did was quite simple; I'm not keen on fiddling around with small-ish controls..!
Be that as it may, the very nature of GNU/Linux positively encourages 'forking', modifying, and re-releasing. I'm absolutely cool with that. And when all's said & done, not everybody wants the added complexity of the redshift back-end...
This is remaining true to the original concept of this thread. So; thanks again. With the number of versions we now have available for this kinda thing, there's bound to be one that will suit most Puppians..!
Nice one.
Mike.
Thanks for that, mate.
The only reason I made the 'control' itself as big as I did was quite simple; I'm not keen on fiddling around with small-ish controls..!
Be that as it may, the very nature of GNU/Linux positively encourages 'forking', modifying, and re-releasing. I'm absolutely cool with that. And when all's said & done, not everybody wants the added complexity of the redshift back-end...
This is remaining true to the original concept of this thread. So; thanks again. With the number of versions we now have available for this kinda thing, there's bound to be one that will suit most Puppians..!
Nice one.
Mike.
Do you have a test pet that I could trial on Slacko 5.6? (I am not keen to add sct or yad). cheers!MochiMoppel wrote:Xrandr itself is not a problem and - unlike johnywhy's approach - works for me. I also noticed that parsing its output for Brightness rather than for connected gives better results as xrandr will list Brightness of a monitor only if it's actually "on". A laptop with lid closed and screen off is still listed as connected but Brightness is not included in its properties list.
- Mike Walsh
- Posts: 6351
- Joined: Sat 28 Jun 2014, 12:42
- Location: King's Lynn, UK.
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Sorry, no pet, just a testscript. I haven't tested extensively since I don't need and use it. IIRC worked OK on my Slacko 5.6.greengeek wrote:Do you have a test pet that I could trial on Slacko 5.6? (I am not keen to add sct or yad). cheers!
Uses gtkdialog and Xdialog.
Supports more than 1 attached monitor (e.g. Laptop/Docking station + external monitor)
Supports Up/Down keys
Exits when focus is reset to window or desktop
I tested with a traybutton in JWM. No icon, just a Unicode symbol:
Code: Select all
<TrayButton label="◑">exec:/usr/bin/mm_brightness_slider</TrayButton>
Code: Select all
#!/bin/bash
ALIVE=$(xrandr --verbose | tr "\n" "\x0" | sed ' #replace linefeeds with NULL characters, thus putting the whole output on a single line
s/\x0[A-Z]/\n&/g #xrandr output is indented. Only 'Screen' and Monitors appear left aligned, i.e they follow immediately after a linefeed. This command adds a 'real' lf before them
s/\x0//g' | sed -r ' #remove all NULL characters and pipe to another sed in order to detect newly inserted LFs
/Brightness/!d #remove all lines not containing Brightness (leaving only monitors set 'on')
')
MON=$(echo "$ALIVE" | awk '{print $1}') #may produce more than 1 monitor
if [ $(echo "$MON" | wc -l) -gt 1 ];then #if more than 1, ask!
XLIST=
for monitor in $MON ;do
XLIST="$XLIST $monitor $monitor off"
done
MON=$(Xdialog --title "Brightness" --under-mouse --stdout --no-tags --radiolist "Please select monitor" x 4 $XLIST)
[ $? != 0 ] && exit
fi
BrCur=$(echo "$ALIVE" | sed -nr "s/$MON.*Brightness[: ]*([0-9.]*).*/\1/p" )
BrMax=1
BrMin=0.1
export STARTTIME=$(date +%s%2N) #work around for bug that immediately fires focus-out-event (= exit) when slider opened on a desktop with no windows
echo -n '
<window type-hint="6" margin="0" window_position="2">
<vscale range-value="'$BrCur'" range-min="'$BrMin'" range-max="'$BrMax'" range-step="0.05" width-request="28" height-request="200" inverted="true">
<variable>vSLIDER</variable>
<action>xrandr --output "'$MON'" --brightness $vSLIDER</action>
</vscale>
<action signal="focus-out-event" condition="command_is_true(N=$(date +%s%2N);[ $((N-STARTTIME)) -gt 150 ] && echo true)">exit:</action>
</window>'|gtkdialog -s
- Attachments
-
- mm_brightness_slider.png
- (9.58 KiB) Downloaded 433 times
My slider seems to have lost it's bottom. Is that something peculiar with my setup?MochiMoppel wrote:I tested with a traybutton in JWM. No icon, just a Unicode symbol:Code: Select all
<TrayButton label="◑">exec:/usr/bin/mm_brightness_slider</TrayButton>
- Attachments
-
- slider_R.jpg
- (7.75 KiB) Downloaded 390 times
-
- slider_L.jpg
- (19.9 KiB) Downloaded 395 times
- MochiMoppel
- Posts: 2084
- Joined: Wed 26 Jan 2011, 09:06
- Location: Japan
Definitely. In a pristine Slacko 5.6. the whole slider would be displayed. Your screenshot looks very strange. IMO this can only happen when the selected screen resolution and the physical resolution of the monitor don't match or when the wm is buggy. A window manager should never ever open a window off screen. Which JWM version do you use?greengeek wrote:Is that something peculiar with my setup?
- fabrice_035
- Posts: 765
- Joined: Mon 28 Apr 2014, 17:54
- Location: Bretagne / France
hey,
Not working for me
I use that, my old tiny brightness control
Not working for me
Code: Select all
(gtkdialog:5862): Gtk-CRITICAL **: IA__gtk_vscale_new_with_range: assertion 'step != 0.0' failed
(gtkdialog:5862): Gtk-CRITICAL **: IA__gtk_range_set_value: assertion 'GTK_IS_RANGE (range)' failed
**
ERROR:variables.c:189:variables_new_with_widget: assertion failed: (widget != NULL)
./add.sh: line 27: 5861 Done echo -n '
<window type-hint="6" margin="0" window_position="2">
<vscale range-value="'$BrCur'" range-min="'$BrMin'" range-max="'$BrMax'" range-step="0.05" width-request="28" height-request="200" inverted="true">
<variable>vSLIDER</variable>
<action>xrandr --output "'$MON'" --brightness $vSLIDER</action>
</vscale>
<action signal="focus-out-event" condition="command_is_true(N=$(date +%s%2N);[ $((N-STARTTIME)) -gt 150 ] && echo true)">exit:</action>
</window>'
5862 Aborted | gtkdialog -s
Code: Select all
#!/bin/sh
# mini tool ! Easy change luminosity (mouse wheel)
#
# !!!! right for DELL XPS 1640 !!!!
#
# 14 fev 2016
b=`cat /sys/class/backlight/acpi_video0/actual_brightness `
lumi () {
if [ "$hs" -lt "0" ] ; then
hs="1"
echo $(( $b + $hs )) > /sys/class/backlight/acpi_video0/brightness
exit 0
fi
echo $(( $b + $hs )) > /sys/class/backlight/acpi_video0/brightness
}
export -f lumi
GTKDIALOG=gtkdialog
MAIN_DIALOG='
<window title="Lum" decorated="false" skip_taskbar_hint="true" window_position="2">
<vbox border-width="1" spacing="1">
<hbox homogeneous="true">
<button use-stock="true" > <input file stock="gtk-quit"></input> </button>
<hscale space-expand="true" space-fill="true" range-min="1" range-max="16" range-value="'$b'" range-step="1" tooltip-text="change luminosity">
<variable>hs</variable>
<action>lumi</action>
</hscale>
</hbox>
</vbox>
<variable>MAIN_DIALOG</variable>
</window>
'
export MAIN_DIALOG
case $1 in
-d | --dump) echo "$MAIN_DIALOG" ;;
*) $GTKDIALOG --program=MAIN_DIALOG ;;
esac