Brightness & colour temperature control for desktop PCs

Window managers, icon programs, widgets, etc.
Message
Author
User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#21 Post by Mike Walsh »

Hi, Bob,

Hang about. I've just been trying this latest script of Fred's. He's now got it so that the brightness and Color Temperature sliders are both in the same box. Which I think is what you were mentioning earlier on, yes?


Image


I've just been giving it a wee bit of tidying up; what d'you think?


Mike. :wink:

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#22 Post by Moat »

fredx181 wrote:This requires higher yad version, not sure which, I think from 0.35 on, as it uses the --paned option.
Hi Fred - May or may not be a data point, as this quick test is on Ubuntu Mate - neither a Puppy or Dog. Ubuntu's Yad version 0.38.2-1, no errors in console, Redshift of course installed;
Attachments
using_YAD_version_0.38.2-1.jpg
Window elements/sliders not visible...
(39.69 KiB) Downloaded 368 times

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#23 Post by Moat »

Mike Walsh wrote:I've just been giving it a wee bit of tidying up; what d'you think?
Awesome Mike (and Fred!)!!! 8) Yessir... that's what I'm talkin' about! You happy with it, and it's slightly increased size vs. SCT alone? If so, run with it, I'd say!

Bob

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#24 Post by fredx181 »

Hi Mike, Bob,

Mike, I see now what your intentions were.
Mike wrote:Where d'you get your redshift from? Repos.....or from Jon Lund Steffenson's site?
From repos, should be pretty straightforward to install from PPM.
Tried on Slacko, went well, on Tahr, it's installing also redshift-gtk, so took some more space (but redshift-gtk diidn't run for me, btw)
Well, now. Let's see what happens, shall we?.....
Yeah, why not :)

@Moat
Hi Fred - May or may not be a data point, as this quick test is on Ubuntu Mate - neither a Puppy or Dog. Ubuntu's Yad version 0.38.2-1, no errors in console, Redshift of course installed;
Strange... only thing that I can think of that the yad on Ubuntu is compiled with gtk3 and doesn't fit somehow with the script, what is your yad version exactly ?, for me it says gtk2:

Code: Select all

# yad --version
0.38.2 (GTK+ 2.24.31)
Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#25 Post by Mike Walsh »

Hiya, Bob.
moat wrote:Awesome Mike (and Fred!)!!! 8) Yessir... that's what I'm talkin' about! You happy with it, and it's slightly increased size vs. SCT alone? If so, run with it, I'd say!
We-e-elll... Ok, it's around 40k more. Sure, I can live with that.....but I'm not going to discard the last set of .pets I put together, with the SCT slider...

Y'see, Bob, this'll be fine for those relatively modern Pups where you can install redshift through the PPM. You might be able to go as far back as Precise, though I have my doubts. I think it was only in recent 'buntus it's even been available from Canonical's own repos.

Older Pups, you're going to be needing a package (well, at least the redshift binary) from elsewhere. And that's going to mean unknown dependencies. Which'll mean departing on my favourite pastime (NOT!!).....an extended 'lib-chase'. (*Joy..!*) :roll:

SCT, I know through testing that the sct binary (which I compiled in Raring) works with a whole range of Pups, as far back as Racy 5.5. So, it might be an idea to leave those .pets available.

I'm just about to see where I can swipe a 'middle-aged' copy of redshift from. (And, er, no; stu90's redshiftgui package won't do.....'cos the command-line is not separate from the GUI side of things; it's all been compiled in together. And for this to work, you need the command-line version.....)

Wish me luck!


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#26 Post by fredx181 »

Hi Bob,
Fred wrote:Strange... only thing that I can think of that the yad on Ubuntu is compiled with gtk3 and doesn't fit somehow with the script, what is your yad version exactly ?, for me it says gtk2:
Tried on Stretch with yad gtk3, and got the same as you, so that must be it, maybe it's a bug in the 0.38 version when compiled with gtk3 :?:
Anyway if you replace in the last line:

Code: Select all

--geometry=450x70-30-30
With:

Code: Select all

--width=450 --height=300
Then both sliders should display (apparently the gtk3 version doesn't read --geometry well)

Fred

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#27 Post by Mike Walsh »

Right, boys & girls.

I've made Fred's latest script up into a .pet pacakge. This one gives you a dual-slider control panel for both colour temperature and screen brightness.....and neither of them will 'cancel' the other out.

It makes use of not the Redshift GUI package (gtk-redshift as it is now), but the 'back-end' to it.....the 'redshift' command-line utility. You should be able to install this through the PPM in most modern Pups.

I'm leaving the 'SCT'-based .pet packages available, for those who can't get hold of the redshift command-line utility.

All packages can be found attached to post #1.


Mike. :wink:

User avatar
MochiMoppel
Posts: 2084
Joined: Wed 26 Jan 2011, 09:06
Location: Japan

#28 Post by MochiMoppel »

fredx181 wrote:I understood that the problem was because xrandr detects only one monitor in Mike's script.
Mike's script detects two monitors but assumes that it detected only one, hence the error.
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.

B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

#29 Post by B.K. Johnson »

Hey Mike and Fred
Just lurking!
No criticism intended, but I see those large temperature numbers and I groan! :P What are they and cannot they be converted to a normal temperature scale?
[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]

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#30 Post by fredx181 »

MochiMoppel wrote:
fredx181 wrote:I understood that the problem was because xrandr detects only one monitor in Mike's script.
Mike's script detects two monitors but assumes that it detected only one, hence the error.
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.
Yes, I see, tested now with external monitor connected to a laptop, xrandr brightness setting fails, will be difficult to solve, I guess, besides that, I think using redshift is a much better option (as I stated already above) because of the sliders for brightness and color not conflicting (in the latest pet from Mike).
Also... it works with both monitors (laptop and external, well, at least for me)

@all
Here's below attached SFS for redshift (32-bit) (remove fake .gz)
I tested on Tahr and Slacko.
B.K. Johnson wrote:No criticism intended, but I see those large temperature numbers and I groan! Razz What are they and cannot they be converted to a normal temperature scale?
These are the redshift values, any suggestion what's "normal temperature scale" ?

Fred
Attachments
redshift.sfs.gz
redshift.sfs 32-bit remove fake .gz
(80 KiB) Downloaded 235 times

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#31 Post by Mike Walsh »

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. :wink:
Last edited by Mike Walsh on Mon 17 Sep 2018, 18:29, edited 2 times in total.

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#32 Post by Mike Walsh »

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'..... :lol:

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
...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. :wink:
Last edited by Mike Walsh on Mon 17 Sep 2018, 21:18, edited 1 time in total.

B.K. Johnson
Posts: 807
Joined: Mon 12 Oct 2009, 17:11

#33 Post by B.K. Johnson »

Thanks for the lesson Mike.
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]

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#34 Post by fredx181 »

Hi Mike,
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.
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.

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

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#35 Post by Mike Walsh »

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.... :lol: :lol:

----------------------------------

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. :wink:

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#36 Post by Moat »

Apologize for the late reply... doggone real life keeps interrupting the real fun! :P

@ 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)
... and your...

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!! 8)

Thanks much, fellas...

Bob
Attachments
ScreenControl_redshift-v1.4-noarch.jpg
On Peebee's Upup Bionic...
(18.06 KiB) Downloaded 466 times

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#37 Post by Mike Walsh »

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.
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! :( )...
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.

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...


Image


(*shrug*)


Mike. :wink:

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#38 Post by belham2 »

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. :wink:

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 :cry:

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.

User avatar
Billtoo
Posts: 3720
Joined: Tue 07 Apr 2009, 13:47
Location: Ontario Canada

Brightness & colour temperature control for desktop PCs

#39 Post by Billtoo »

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.
Hi,

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.

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

Re: Brightness & colour temperature control for desktop PCs

#40 Post by fredx181 »

Billtoo wrote:
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.
Hi,

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
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.
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

Post Reply