Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 18 Nov 2019, 08:50
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Brightness & colour temperature control for desktop PCs
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 6 [88 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Author Message
fredx181


Joined: 11 Dec 2013
Posts: 4159
Location: holland

PostPosted: Sun 16 Sep 2018, 11:15    Post subject:  

MochiMoppel wrote:
fredx181 wrote:
Perhaps the above script solves that problem (doesn't use xrandr), I cannot test atm.
-------------
xrandr wouldn't be a problem.


I understood that the problem was because xrandr detects only one monitor in Mike's script.

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5551
Location: King's Lynn, UK.

PostPosted: Sun 16 Sep 2018, 12:01    Post subject:  

@ MochiMoppel:-

Feedback is appreciated, certainly. Fred's newest script (utilising redshift) probably does get round this.....but I wanted to get away from RedShift.

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

@ fredx181:-

Either you're a mind-reader, mate.....or I am! I've only just found your last but one post; I've been working on a way to implement the SCT slider control you got running (which works fine, BTW.)

I initially thought of making the tray icon call a 'Function Selector', where you decided which 'utility' you wanted (bright or tint), and it then called up each control independently. And then I thought I might just as well call the SCT slider up from the brightness control.....in the same way as the preset buttons.





...and then:-





.....only i set mine on a staggered 'overlap', rather than one above the other.

And that, I feel, is probably about as far as I really intend to take it. It probably won't suit the more finicky amongst us (like Bob! Smile ), who would prefer absolutely everything to work just so. I really don't want to be digging around at the hardware level; this was fully intended to be just a simple, straight-forward control. As previously stated, I wanted to get away from RedShift ( in any guise), and go as 'basic' as it's possible to get while still retaining essential functionality. Which is why I like sct; tiny, yet functional.....in the best 'Puppy' tradition.

But I have to wonder; just where do you 'draw the line' when you're doing this kinda stuff? At what point do you say, 'That's it; enough is enough. It's a done job...'? I'm happy with feedback, sure; it does nothing but help. But as I said, you cannae please everybody.....

(*shrug*)

Pets for the latest (and probably last) 'incarnation' can be found attached to the original post on page 1.....and links for current versions of YAD (0.40.0) - if required - are there also.
Mike. Wink

_________________
MY 'PUPPY' PACKAGES


Last edited by Mike Walsh on Sun 16 Sep 2018, 19:01; edited 1 time in total
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4159
Location: holland

PostPosted: Sun 16 Sep 2018, 12:56    Post subject:  

Hi Mike,

Quote:
But I have to wonder; just where do you 'draw the line' when you're doing this kinda stuff? At what point do you say, 'That's it; enough is enough. It's a done job...'? I'm happy with feedback, sure; it does nothing but help. But as I said, you cannae please everybody.....

(*shrug*)

Pets for the latest (and probably last) 'incarnation' can be found attached below.....


Here we seem to disagree with each other (if you don't mind Smile).

Why not work (together or alone) on something until it's usable for most people ?
That's where sharing is for, that it's not for your own use only.
Just a few days of testing and experimenting is usually not enough to make a good program.
MochiMoppel has a point, just like you had a point when you found that johnywhy's script didn't work for you.

Two things I'd like to see as improvement:
- That it works with most computers.
- That the brightness and temperature sliders don't "reset" each other.
The last, I found, is possible with redshift commandline program, because it can do both.
(with some tweaking, setting just brightness and temperature separate, not resetting each other)
Anything wrong with redshift ? It's maybe a bit bigger than stc, but still small.
(again, to avoid confusion, not talking about redshiftgui)

.... sofar the rant.... excuse me...

Here's another study (again by using redshift), btw, has the two sliders in one dialog:
(not conflicting with each other for me)
Code:
#!/bin/bash

fkey=$(($RANDOM * $$))

[ -z "$(cat /tmp/clr_temp 2> /dev/null)" ] && echo 6500 > /tmp/clr_temp
[ -z "$(cat /tmp/BR_value 2> /dev/null)" ] && echo 100 > /tmp/BR_value
# export BR_VALUE=$(cat /tmp/BR_value 2> /dev/null)
[ "$(cat /tmp/clr_temp 2> /dev/null)" ] && TCur=$(cat /tmp/clr_temp 2> /dev/null) || TCur=6500
TMax="8000"
TMin="2000"
yad --plug="$fkey" --tabnum=1 --undecorated --on-top --text="\t\tRedshift   Temperature   Setting" --scale --value $TCur --print-partial --min-value $TMin --max-value $TMax --button="Done":1 | while read TNew; do
echo $TNew > /tmp/clr_temp
redshift -l : -O $TNew -b $(awk "BEGIN {print $(cat /tmp/BR_value 2> /dev/null)/100}") 1>/dev/null
done &

[ "$(cat /tmp/BR_value 2> /dev/null)" ] && BrCur=$(cat /tmp/BR_value 2> /dev/null) || BrCur=100
BrMax="100"
BrMin="10"
yad --plug="$fkey" --tabnum=2  --undecorated --on-top --text="                  Screen   Brightness   Control" --scale --value $BrCur --print-partial --min-value $BrMin --max-value $BrMax --button="Tint":'bash -c color_ctrl' --button="Done":1 | while read BrNew; do
echo $BrNew > /tmp/BR_value
redshift -l : -O $(cat /tmp/clr_temp) -b $(awk "BEGIN {print $BrNew/100}") 1>/dev/null
done &

yad --center --paned --key="$fkey" --undecorated  --button="gtk-quit:1" --buttons-layout=center --geometry=450x70-30-30 --orient=vert


This requires higher yad version, not sure which, I think from 0.35 on, as it uses the --paned option.

EDIT: Made some small changes in the code above.
One thing may be better: To replace /tmp with some path that will be preserved after reboot (for the files that keep the values), but not sure yet.
EDIT2: To explain: this part of redshift command:
Code:
redshift -l :

may look a bit strange.
It's just empty value for "latitude:longitude".
Without specifying the "-l" value, redshift will complain, so empty values is the workaround.

Fred
2018-09-16-180529_503x226_scrot.png
 Description   
 Filesize   98.43 KB
 Viewed   343 Time(s)

2018-09-16-180529_503x226_scrot.png


_________________
Dog Linux website
Tinylinux blog by wiak

Last edited by fredx181 on Sun 16 Sep 2018, 13:44; edited 1 time in total
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5551
Location: King's Lynn, UK.

PostPosted: Sun 16 Sep 2018, 13:33    Post subject:  

Hi, Fred.

Oh, it's not that I've got anything against Redshift..! I was just trying to go as small as possible, that was all. But you're right, of course; a version that works for as many people as possible would definitely be best.

Where d'you get your redshift from? Repos.....or from Jon Lund Steffenson's site?

I was doing some experimenting with rg66's twin-slider option, but I couldn't figure out how to get the function stuff working with it at all, since I found that if you don't have both fields in the same line, you only get the first one showing.....even when 'escaping' between them.

I've still got a lot to learn, y'know!

I'll give this latest version a whirl. I'm in Xenial64 ATM; I installed Redshift through the repos, so you get the commandline version anyway.

(Hm. Only 55k. Not as big as I thought.)

Well, now. Let's see what happens, shall we?.....


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Moat


Joined: 16 Jul 2013
Posts: 967
Location: Mid-mitten

PostPosted: Sun 16 Sep 2018, 14:30    Post subject:  

Mike Walsh wrote:
It probably won't suit the more finicky amongst us (like Bob! Smile )...


Laughing Laughing Eh, like I mentioned - ignore me!! Laughing I've got nothing better to do this weekend than pester, and just thought my pestering could maybe, possibly add a little something to the otherwise constructive dialog. But yep - I totally agree with you on the simplicity/size of SCT, and the (me too, personally) lack of need for all of the background Redshift auto-adjust fluff. Appears to boil down to limitations inherent in each application in regards to this particular goal (Redshift = unnecessary bloat, SCT = lack of brightness/tint control separation). All a compromise, I guess - no matter how ya' slice it, eh? Smile

I need to boot up a Pup here, and try your latest .pets - looks like an excellent all-around, super-lightweight solution...!! Cool

Bob
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5551
Location: King's Lynn, UK.

PostPosted: Sun 16 Sep 2018, 14:44    Post subject:  

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?





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


Mike. Wink

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
Moat


Joined: 16 Jul 2013
Posts: 967
Location: Mid-mitten

PostPosted: Sun 16 Sep 2018, 14:53    Post subject:  

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;
using_YAD_version_0.38.2-1.jpg
 Description   Window elements/sliders not visible...
 Filesize   39.69 KB
 Viewed   311 Time(s)

using_YAD_version_0.38.2-1.jpg

Back to top
View user's profile Send private message 
Moat


Joined: 16 Jul 2013
Posts: 967
Location: Mid-mitten

PostPosted: Sun 16 Sep 2018, 15:00    Post subject:  

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


Awesome Mike (and Fred!)!!! Cool 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
Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4159
Location: holland

PostPosted: Sun 16 Sep 2018, 15:34    Post subject:  

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)

Quote:
Well, now. Let's see what happens, shall we?.....


Yeah, why not Smile

@Moat
Quote:
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:
# yad --version
0.38.2 (GTK+ 2.24.31)


Fred

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5551
Location: King's Lynn, UK.

PostPosted: Sun 16 Sep 2018, 15:48    Post subject:  

Hiya, Bob.

moat wrote:
Awesome Mike (and Fred!)!!! Cool 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..!*) Rolling Eyes

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

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4159
Location: holland

PostPosted: Sun 16 Sep 2018, 17:14    Post subject:  

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 Question
Anyway if you replace in the last line:
Code:
--geometry=450x70-30-30

With:
Code:
--width=450 --height=300

Then both sliders should display (apparently the gtk3 version doesn't read --geometry well)

Fred

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
Mike Walsh


Joined: 28 Jun 2014
Posts: 5551
Location: King's Lynn, UK.

PostPosted: Sun 16 Sep 2018, 19:08    Post subject:  

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

_________________
MY 'PUPPY' PACKAGES

Back to top
View user's profile Send private message 
MochiMoppel


Joined: 26 Jan 2011
Posts: 1925
Location: Japan

PostPosted: Sun 16 Sep 2018, 22:13    Post subject:  

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.
Back to top
View user's profile Send private message 
B.K. Johnson

Joined: 12 Oct 2009
Posts: 773

PostPosted: Mon 17 Sep 2018, 12:33    Post subject:  

Hey Mike and Fred
Just lurking!
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?

_________________
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

Back to top
View user's profile Send private message 
fredx181


Joined: 11 Dec 2013
Posts: 4159
Location: holland

PostPosted: Mon 17 Sep 2018, 13:13    Post subject:  

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
redshift.sfs.gz
Description  redshift.sfs 32-bit remove fake .gz
gz

 Download 
Filename  redshift.sfs.gz 
Filesize  80 KB 
Downloaded  158 Time(s) 

_________________
Dog Linux website
Tinylinux blog by wiak
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 2 of 6 [88 Posts]   Goto page: Previous 1, 2, 3, 4, 5, 6 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Desktop
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0776s ][ Queries: 12 (0.0078s) ][ GZIP on ]