Redshift Gui Light Alternative (portable)

Moderator: Forum moderators

Post Reply
User avatar
fredx181
Posts: 3177
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 389 times
Been thanked: 1365 times
Contact:

Redshift Gui Light Alternative (portable)

Post by fredx181 »

Update 06-01-2025, version 6, better preserving brightness settings now when rebooted, more info: viewtopic.php?p=139475#p139475 (and a .pet package attached for EasyOs)
Added attachments for 32 and 64 bit (v6) below.

Update 23-12-2024, version 5, using 'backlight' now for reducing brightness, more info: viewtopic.php?p=138611#p138611
Added attachments for 32 and 64 bit (v5) below.

Update 08-11-2024, v4 with fix from @BarryK , see viewtopic.php?p=135185#p135185
New attachments for 32 and 64 bit below.

Earlier shared Here
Inspired by Mike Walsh's Brightness & colour temperature control for desktop PCs, here's a more extended version that supports redshift's automatic day and night colour transition (if in "Auto mode")
If Auto mode is not selected, then it works just the same as Mike's version (e.g. ScreenControl_redshift-v1.4)

Similar apps already existing, e.g:
https://sourceforge.net/projects/redshiftgui/
Or (more simple, python based):
https://github.com/mlsteele/redshift-gui

This portable version uses yad (notification icon and sliders to adjust the values) and the redshift command line utility.

Both (yad and redshift) I compiled on Debian Wheezy, tested (and works) on Puppy Lucid, Raring, Slacko, Tahr, Stretch (and should work also on later Puppy versions)
Also on Debiandog, Xenialdog, Bionicdog, Busterdog, Fossadog
Also separate "wary" version attached, works on Wary or other older puppies with minimal Xorg version.

From the Help (right-click on the icon):

Quote:
*** Redshift Manual mode and Auto mode ***

  • Manual: First time run, the Manual mode is enabled.
    Left click the icon and adjust color temp. and brightness.

  • Auto: Right-click the icon and select 'Redshift Auto mode'.
    The timezone and time must be correctly set to make this work well.
    First time run, it will get your geo location (the coordinates: latitude, longitude)
    A network connection is required for that.
    The file $HOME/.rshift/geo-info contains this info.
    Remove it if you travel to another country or city.
    (then it will be re-configured again)
    Left click on the icon to adjust day and night color temp.
    To get back to Manual Mode, click 'Redshift Auto mode' again.

Portable: includes yad (v 0.38 ) and redshift (v 1.11) (self-extractable script) so NOT needed to have yad and redshift installed.

Required is "curl" for getting geo location (but should be installed by default in most systems)

Extract 32 or 64 bit attached tar.gz and just click on e.g. rshift-portable-32 and the icon should appear in the system-tray.
To have it loaded at boot/logon, place it in ~/Startup

Fred

Redshift auto-mode
Redshift auto-mode
redshift-auto-mode.png (331.28 KiB) Viewed 3166 times
rshift-portable32-v6.tar.gz
Redshift portable 32-bit v6, extract and run rshift-portable-32-v6
(196.58 KiB) Downloaded 4 times
rshift-portable64-v6.tar.gz
Redshift portable 64-bit v6, extract and run rshift-portable-64-v6
(201.33 KiB) Downloaded 9 times
rshift-portable-wary-v3.tar.gz
Redshift portable Wary, extract and run rshift-portable-wary
(242.84 KiB) Downloaded 140 times
yuan
Posts: 11
Joined: Fri Nov 27, 2020 5:41 pm

Re: Redshift Gui Light Alternative (portable)

Post by yuan »

Hi,fredx181
How do I change tray of rshift-portable icon and size?

User avatar
BarryK
Posts: 2823
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 144 times
Been thanked: 773 times

Re: Redshift Gui Light Alternative (portable)

Post by BarryK »

@fredx181
Fred, I have just tried your v3, and for me the red shift only works one-way.
If I slide left, increasing redness, then the screens gets redder, as expected. However, if I slide back up, the screen does not get less red.
If I slide down again, the screen gets redder than before.

I am running on a PC with 8th gen i3 CPU, inbuilt gpu, so pretty standard. redshift is version 1.12, compiled like so:

# ./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc --build=x86_64-pc-linux-gnu --with-systemduserunitdir=no --disable-apparmor --disable-ubuntu --disable-gui

I pulled out the redshift slider code, made a separate test script:

Code: Select all

#!/bin/bash

  killall redshift 2> /dev/null 
  redshift -l : -O $(cat $HOME/.rshift/clr_temp 2> /dev/null) -b $(awk "BEGIN {print $(cat $HOME/.rshift/BR_value 2> /dev/null)/100}") 1>/dev/null
  TCur=$(cat $HOME/.rshift/clr_temp 2> /dev/null) 
  TMax="6500" 
  TMin="2400" 

#  yad --plug="$fkey" --tabnum=1 --undecorated --on-top --borders 5 --text="        Redshift Color Temp. Setting" --scale --value $TCur --print-partial --min-value $TMin --max-value $TMax | 
  yad  --undecorated --on-top --borders 5 --text="        Redshift Color Temp. Setting" --scale --value $TCur --print-partial --min-value $TMin --max-value $TMax |
  while read TNew; do 
   echo $TNew > $HOME/.rshift/clr_temp 
   echo "RUN: redshift -l : -O $TNew -b $(awk "BEGIN {print $(cat $HOME/.rshift/BR_value 2> /dev/null)/100}") 1>/dev/null"
   redshift -l : -O $TNew -b $(awk "BEGIN {print $(cat $HOME/.rshift/BR_value 2> /dev/null)/100}") 1>/dev/null 
  done #& #run loop in the background.

redshift is being fed values correctly:

Code: Select all

# ./test1
RUN: redshift -l : -O 6483 -b 1 1>/dev/null
RUN: redshift -l : -O 6449 -b 1 1>/dev/null
RUN: redshift -l : -O 6415 -b 1 1>/dev/null
RUN: redshift -l : -O 6380 -b 1 1>/dev/null
RUN: redshift -l : -O 6415 -b 1 1>/dev/null
RUN: redshift -l : -O 6449 -b 1 1>/dev/null
RUN: redshift -l : -O 6466 -b 1 1>/dev/null
RUN: redshift -l : -O 6483 -b 1 1>/dev/null
RUN: redshift -l : -O 6500 -b 1 1>/dev/null
RUN: redshift -l : -O 6466 -b 1 1>/dev/null
RUN: redshift -l : -O 6432 -b 1 1>/dev/null
RUN: redshift -l : -O 6398 -b 1 1>/dev/null
RUN: redshift -l : -O 6329 -b 1 1>/dev/null
RUN: redshift -l : -O 6295 -b 1 1>/dev/null
RUN: redshift -l : -O 6329 -b 1 1>/dev/null
RUN: redshift -l : -O 6346 -b 1 1>/dev/null
RUN: redshift -l : -O 6363 -b 1 1>/dev/null
RUN: redshift -l : -O 6398 -b 1 1>/dev/null
RUN: redshift -l : -O 6432 -b 1 1>/dev/null
RUN: redshift -l : -O 6466 -b 1 1>/dev/null
RUN: redshift -l : -O 6500 -b 1 1>/dev/null

...but it still only works one-way, gets redder only.

So, I replaced the redshift 1.12 that I had compiled, with the binary from your x64 portable, and hey, it works!

User avatar
BarryK
Posts: 2823
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 144 times
Been thanked: 773 times

Re: Redshift Gui Light Alternative (portable)

Post by BarryK »

The obvious next thing to do, I downloaded version 1.11 source, configured it exactly as above...

and it works!

I have reported the problem:

https://github.com/jonls/redshift/issues/854

User avatar
fredx181
Posts: 3177
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 389 times
Been thanked: 1365 times
Contact:

Re: Redshift Gui Light Alternative (portable)

Post by fredx181 »

BarryK wrote:

I downloaded version 1.11 source, configured it exactly as above...

and it works!

Thanks Barry, yes, the 1.12 version is behaving weird for me too, looks like the "one shot manual mode (set color temperature)" (-O) option doesn't work properly.

EDIT: I experimented using 1.12 by adding -P option (Reset existing gamma ramps before applying new color effect) (so, replaced "-O" with "-P -O") and it works as it should, perhaps the thing is that it is required for the newer 1.12 version.
E.g:
redshift -P -O 2500
and back to 6500:
redshift -P -O 6500

User avatar
BarryK
Posts: 2823
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 144 times
Been thanked: 773 times

Re: Redshift Gui Light Alternative (portable)

Post by BarryK »

@fredx181
EasyOS has your rshift, the guys like it. I also use it on one of my laptops that has a too-bright screen.

I've received a request. In manual mode, it doesn't pre-load the BR_value and clr_temp value; you have to click on the tray icon to activate them. This is in manual mode. The request is, could this be done when rshift starts up.

Yeah, me too. On my too-bright laptop, I have to click the tray icon at every startup.

I have inserted this, near the beginning of the script, just after loading the default values:

Code: Select all

mkdir -p $HOME/.rshift
[ -z "$(cat $HOME/.rshift/BR_value 2> /dev/null)" ] && echo 100 > $HOME/.rshift/BR_value
[ -z "$(cat $HOME/.rshift/clr_temp 2> /dev/null)" ] && echo 6500 >  $HOME/.rshift/clr_temp

#20241108
if [ ! -f $HOME/.rshift/rshift_auto_mode ];then
 killall redshift  2> /dev/null
 redshift -l : -O $(cat $HOME/.rshift/clr_temp 2> /dev/null) -b $(awk "BEGIN {print $(cat $HOME/.rshift/BR_value 2> /dev/null)/100}") 1>/dev/null
fi

Does that look reasonable to you?
I suppose the "killall redshift" is superfluous.

User avatar
mikewalsh
Moderator
Posts: 6276
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 837 times
Been thanked: 2027 times

Re: Redshift Gui Light Alternative (portable)

Post by mikewalsh »

@fredx181 / @BarryK :-

Perhaps the issue now being displayed on current versions in mainstream distros is affecting things here, too......where 'standard' RedShift no longer connects to the geo-location server? Maybe this has fed through to the CLI version, and is screwing things up somehow?

Just a thought, like.... Feel free to ignore this if not relevant.

Mike. ;)

User avatar
fredx181
Posts: 3177
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 389 times
Been thanked: 1365 times
Contact:

Re: Redshift Gui Light Alternative (portable)

Post by fredx181 »

BarryK wrote: Fri Nov 08, 2024 2:00 am

@fredx181
EasyOS has your rshift, the guys like it. I also use it on one of my laptops that has a too-bright screen.

I've received a request. In manual mode, it doesn't pre-load the BR_value and clr_temp value; you have to click on the tray icon to activate them. This is in manual mode. The request is, could this be done when rshift starts up.

Yeah, me too. On my too-bright laptop, I have to click the tray icon at every startup.

I have inserted this, near the beginning of the script, just after loading the default values:

Code: Select all

mkdir -p $HOME/.rshift
[ -z "$(cat $HOME/.rshift/BR_value 2> /dev/null)" ] && echo 100 > $HOME/.rshift/BR_value
[ -z "$(cat $HOME/.rshift/clr_temp 2> /dev/null)" ] && echo 6500 >  $HOME/.rshift/clr_temp

#20241108
if [ ! -f $HOME/.rshift/rshift_auto_mode ];then
 killall redshift  2> /dev/null
 redshift -l : -O $(cat $HOME/.rshift/clr_temp 2> /dev/null) -b $(awk "BEGIN {print $(cat $HOME/.rshift/BR_value 2> /dev/null)/100}") 1>/dev/null
fi

Does that look reasonable to you?
I suppose the "killall redshift" is superfluous.

Yes, tried that and it's a good fix, thanks. (yes, without killall redshift).

Updated First post with new attachments including the fix (v4).

User avatar
fredx181
Posts: 3177
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 389 times
Been thanked: 1365 times
Contact:

Re: Redshift Gui Light Alternative (portable)

Post by fredx181 »

*** Updated redshift-portable ***

Reading the topic "How to lower the screen brightness?" in the EasyOs section about redshift's brightness adjustment setting and specially here: viewtopic.php?p=137753#p137753, inspired me to make some changes for the redshift-portable program. Thanks for the info, @SteveS .

Version 5: for adjusting brightness it is using 'backlight' now (from /sys/class/backlight/*) .
(btw, note: brightness setting is only available in the "manual" mode)

Attachments (v5) at first post

EDIT: @BarryK please test and then perhaps update to this v5 in EasyOs.
EDIT2: Forgot to mention earlier: In case that backlight setting is not available (on your computer), the brightness adjusting will be handled by redshift .

SteveS
Posts: 31
Joined: Tue Sep 24, 2024 4:00 pm
Been thanked: 11 times

Re: Redshift Gui Light Alternative (portable)

Post by SteveS »

Hello @fredx181 ,

I wasn't very available these past few days, but I can finally reply in detail to this post https://forum.puppylinux.com/viewtopic. ... 15#p138615 saying:

fredx181 wrote: Mon Dec 23, 2024 2:58 pm
SteveS wrote: Fri Dec 13, 2024 6:36 am

A left click on this icon indeed gives access to Redshift's brightness adjustment setting.

As a side note,

EasyOS was totally unusable for me at first because my eyes cannot tolerate the brightness reduction method of Redshift.
It gave me eye strain and headaches.

It was quite painful but I didn't want to give up on this OS, so I investigated...
...
...

Please test if v5 is an improvement for your issue, I think it is, but cannot be sure.
https://forum.puppylinux.com/viewtopic. ... 11#p138611

So, I tested rshift-portable64-v5 on a brand new EasyOS install to avoid any doubts with my previous settings.

First thing:
Yes, I confirm that v5 is a real improvement :thumbup:

And here are my observations:
1. A left click on the Redshift tray icon still gives access to the brightness adjustment settings.
2. The 'Screen Brightness Setting' now effectively uses 'backlight' instead of 'gamma' modification.
3. A right click on the Redshift tray icon still gives access to the Redshift menu.
4. Clicking on the 'Redshift auto mode' still automatically changes the 'color temperature' value accordingly.
5. Activating the 'Redshift auto mode' maintains the 'Screen Brightness Setting' value manually set before.
6. Deactivating the 'Redshift auto mode' still maintains the 'Screen Brightness Setting' value.
And also:
7. Activating or reactivating the 'Redshift auto mode' still causes loss of access to the 'Screen Brightness Setting' manual adjustment feature.
8. Deactivating the 'Redshift auto mode' still brings the 'Screen Brightness Setting' feature back.
9. So, the switch between "Redshift" mode / "manual" mode remains the same.
But:
10. There is no persistence of settings after a reboot.

I've tried to be as complete and detailed as possible!

What can be improved?
Persistence of settings after a reboot, as for rshift_tray-20241108.pet (by @BarryK for EasyOS).

Your application with persistence would be perfect as it would be lighter and easier than any other alternative.

Attachments
rshift_tray-20241108.pet
(25.59 KiB) Downloaded 10 times
User avatar
fredx181
Posts: 3177
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 389 times
Been thanked: 1365 times
Contact:

Re: Redshift Gui Light Alternative (portable)

Post by fredx181 »

@SteveS and @BarryK

Thanks Steve for the detailed reply ! :thumbup:

Here's new package rshift_tray-20250106.pet for EasyOs. (Also updated the portable version (v6 now) with fix for brightness setting, attachments at first post)

rshift_tray-20250106.pet
New . pet for EasyOs rshift_tray-20250106.pet
(26.15 KiB) Downloaded 19 times

Note that it only works properly with redshift version 1.11 (later versions have different options, so won't work with this setup).

Many changes, e.g. using 'backlight' (if available) for adjusting brightness.
(if not available it uses redshift for brightness setting)
And e.g. added 'Brightness' button on window in case of auto-mode.
(didn't like the inconvenience that brightness could only be set at 'manual mode')

When in "Auto Mode" : (left-clicking the icon)

When chosen 'auto-mode'
When chosen 'auto-mode'
2025-01-06_17-10-05.gif (480.14 KiB) Viewed 324 times

And settings, including brightness, should be preserved now at reboot.

I'm no good with translation, so probably the included .pot file needs to be updated.
(only modified the /usr/bin/rshift script)

User avatar
mikewalsh
Moderator
Posts: 6276
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 837 times
Been thanked: 2027 times

Re: Redshift Gui Light Alternative (portable)

Post by mikewalsh »

@fredx181 :-

Thanks for the rebuilt "v6" portables, Fred. Mirrored here:-

https://drive.google.com/drive/folders/ ... sp=sharing

Cheers.

Mike. ;)

SteveS
Posts: 31
Joined: Tue Sep 24, 2024 4:00 pm
Been thanked: 11 times

Re: Redshift Gui Light Alternative (portable)

Post by SteveS »

Thanks @fredx181 for the quick update!

I installed the new rshift_tray-20250106.pet on a fresh EasyOS.
'Screen Brightness Setting' and 'Redshift auto mode' work well as expected. Great job!

There's just one last detail (already present in the previous rshift_tray app):
The application's window bottoms are truncated and sometimes I can't see everything...

I've taken 3 screenshots to show what's going on:

With a left click without 'Redshift auto mode':

capture1.jpg
capture1.jpg (158.15 KiB) Viewed 236 times

When 'Redshift auto mode' is activated:

capture2.jpg
capture2.jpg (158.33 KiB) Viewed 236 times

With a left click after activating the 'Redshift auto mode':

capture3.jpg
capture3.jpg (163.75 KiB) Viewed 236 times

Just in case: my screen resolution is 1366x768. Nothing special. And I only use one screen.

It would be great if someone could find a solution to make all application windows stop just above the JWM taskbar!

User avatar
fredx181
Posts: 3177
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 389 times
Been thanked: 1365 times
Contact:

Re: Redshift Gui Light Alternative (portable)

Post by fredx181 »

SteveS wrote: Tue Jan 07, 2025 2:37 am

Thanks @fredx181 for the quick update!

I installed the new rshift_tray-20250106.pet on a fresh EasyOS.
'Screen Brightness Setting' and 'Redshift auto mode' work well as expected. Great job!

Ok, Nice !

There's just one last detail (already present in the previous rshift_tray app):
The application's window bottoms are truncated and sometimes I can't see everything...

It has to do with the yad version in EasyOs that's not working as it should.
Installing another version from here: viewtopic.php?p=9063#p9063 (0.40 amd64, GTK2 based) fixes it for me on Easy (well, for the "yad" windows).
The portable v6 works best (it has yad 0.40 and special version of box_splash built in), but doesn't have translation support.
Edit: Looking at your screenshot. Why does it show so little info at the green window ?

SteveS
Posts: 31
Joined: Tue Sep 24, 2024 4:00 pm
Been thanked: 11 times

Re: Redshift Gui Light Alternative (portable)

Post by SteveS »

That's it!

The yad v0.40 .pet you shared solves the issue for yad windows on EasyOS.

Don't worry for the green window on the screenshot, I had quickly edited the infos with Gimp...
...maybe a bit too well-edited ah ah

You can find here my contribution to rshift_tray where I edited some English strings for better harmonisation and updated localisation and .pot file.

Don't hesitate to take what you find useful for your rshift-portable versions :)

Attachments
rshift_tray-20250108.pet
(24.08 KiB) Downloaded 10 times
User avatar
mikewalsh
Moderator
Posts: 6276
Joined: Tue Dec 03, 2019 1:40 pm
Location: King's Lynn, UK
Has thanked: 837 times
Been thanked: 2027 times

Re: Redshift Gui Light Alternative (portable)

Post by mikewalsh »

@fredx181 :-

fredx181 wrote: Tue Jan 07, 2025 12:15 pm

Edit: Looking at your screenshot. Why does it show so little info at the green window ?

At a guess, Fred, the user is very privacy-focused, and doesn't want to give anything away about their location or other stuff that might be used to "track" them...so they've "hidden" it.

Which makes me unusual these days. I couldn't care less WHO knows my name, or where I live, etc, etc. I have nothing to hide, next to no money in the bank. I guess I SHOULD be more concerned about identity theft, but I'm not; I hark from an earlier period in internet history, when the web was a far more innocent place.

I daresay many here would call me a fool....

(*shrug...*)

Mike. ;)

SteveS
Posts: 31
Joined: Tue Sep 24, 2024 4:00 pm
Been thanked: 11 times

Re: Redshift Gui Light Alternative (portable)

Post by SteveS »

I am going to be quite off-topic this time!

@mikewalsh ,

I'm totally agree with everything you said, but here in France we have a big problem: private data of the entire population of the country is available for sale on the dark web due to multiple data breaches related to the hacking of large companies, hospitals, Internet Service Providers, and public services.

Here, more than 200,000 people fall victim to online identity theft every year. This country, relative to its size, has now become one of the most targeted countries in the world for online scams and data theft attempts...

No money? No problem!
2 real examples:
Thousands of drivers assume a false identity to avoid paying increasingly automated and severe traffic fines. It is the victim who receives the fines at their home instead, with the obligation to pay before they can legally contest.
There are also thousands of people who assume a false identity to take advantage of the victims' medical insurance and make them pay for their medications and medical care.

While the USA now encourages freedom of speech and the end of fact-checking, France now encourages its people to keep their mouths shut :)

Insurance companies can now hold you liable for identity theft if you have publicly revealed personal data or clues that are a bit too precise.

I too miss the early days of the Internet, where everyone just wanted to help each other for free without hostile ulterior motives... and without the CAPTCHAs and European GDPR cookie consent banners everywhere!

And no, you are not a fool Mike, you are pure ;)

darksun
Posts: 137
Joined: Tue Dec 19, 2023 10:12 am
Location: behind a vpn
Has thanked: 55 times
Been thanked: 43 times

Re: Redshift Gui Light Alternative (portable)

Post by darksun »

SteveS wrote: Thu Jan 09, 2025 7:24 am

While the USA now encourages freedom of speech and the end of fact-checking, France now encourages its people to keep their mouths shut :)

the best way to keep your private data safe is to not creating it in the first place. Wherever and whenever possible people should avoid creating and/or sharing your data in the first place, and as well as limit the use of social media or even better do not use them at all, and so on.

Post Reply

Return to “Desktop”