Redshift Gui Light Alternative (portable)

Moderator: Forum moderators

Post Reply
User avatar
fredx181
Posts: 2539
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 268 times
Been thanked: 974 times
Contact:

Redshift Gui Light Alternative (portable)

Post by fredx181 »

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 1681 times
Attachments
rshift-portable-32-v3.tar.gz
Redshift portable 32-bit, extract and run rshift-portable-32
(199.47 KiB) Downloaded 115 times
rshift-portable-64-v3.tar.gz
Redshift portable 64-bit, extract and run rshift-portable-64
(201.91 KiB) Downloaded 146 times
rshift-portable-wary-v3.tar.gz
Redshift portable Wary, extract and run rshift-portable-wary
(242.84 KiB) Downloaded 81 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: 2246
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 550 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: 2246
Joined: Tue Dec 24, 2019 1:04 pm
Has thanked: 93 times
Been thanked: 550 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: 2539
Joined: Tue Dec 03, 2019 1:49 pm
Location: holland
Has thanked: 268 times
Been thanked: 974 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

Post Reply

Return to “Desktop”