Redshift Plasmoid
KDE Plasma 4 Extensions
Score 76%
Description:

Redshift plasmoid provides a configuration interface and allows to start/stop Redshift daemon either manually or automatically based on the current activity.


Important note
After install, reboot or run redshiftautostart manually to start using the plasmoid.


Issue & Feature Request
Any issue or feature request can be posted to this github page:
https://github.com/simgunz/redshift-plasmoid/issues


More Info
- Redshift: http://jonls.dk/redshift/
Last changelog:

3 years ago

1.0
Improve plasmoid status behavior
Add global shortcut to toggle redshift on/off
Add Czech translation (thanks to Pavel Fric)
Add Spanish translation (thanks to ThecaTTony)
Add doxygen comments and documentation
Code cleaning

0.6.2
Minor translation fixes

0.6.1
Add trayicon status passive when not in manual mode
Update readme with Qt5 build error solution
Fix entry name error

0.6
Add osd for manual mode
Add German translation (thanks to Matthias Mail

pepedopolous

5 years ago

I suppose a preview button would be fine.
The tooltip for this could be something like 'preview day to night transition'.
However, would this work in the instance that you had just installed redshift for the first time and placed the plasmoid somewhere? Redshift wouldn't be running so the code would have to start redshift if it isn't already running I guess.

Report

simgunz

5 years ago

Should work like this:
Suspend redshift of the plasmoid if running, run the loop, reenable redshift from the plasmoid.

I tried this. It's a bash script just to try out.
It needs usleep from here:
https://github.com/coolaj86/msleep-commandline

#!/bin/bash
temp=6500
redshift -x -m vidmode
while [ $temp -gt 2500 ]; do
redshift -O $temp -m vidmode
temp=$[$temp-10]
usleep 10000
done

Report

pepedopolous

5 years ago

Just tried it and it works for me (didn't know how red it could go!)

Report

pepedopolous

5 years ago

I didn't fully read your comment.
I don't know what usleep is!
However I'm pretty sure your bash script does the job perfectly on my setup.

Report

pepedopolous

5 years ago

Hi.
Love this plasmoid but since updatess to nvidia (302) and/or the kernel (3.4.4) it stopped working.

To fix it I made a config file to specify vidmode rather than randr.

Would you consider adding an option of choosing the method from the plasmoid so users in the future can choose the one which works for their hardware? Many thanks.
P

Report

simgunz

5 years ago

Actually I didn't add that option intentionally because redshift should fallback to vidmode when randr doesn't work. Infact this is the behaviour on my machine.

If you just launch redshift in the shell without specifing anything which is the output?

I usually get this:
Failed to start adjustment method randr.
Trying next method...
Using method `vidmode'.

In any case I can add that option in the plasmoid.

Report

pepedopolous

5 years ago

Hi, thanks for your reply.
If I don't specify the method, redshift appears to start successfully using randr.
However, nothing happens on the screen, so when using the plasmoid it doesn't work either.
The vidmode issue has been noted by the redshift developer: -
https://bugs.launchpad.net/redshift/+bug/1018229

Report

simgunz

5 years ago

I've added the option.
Try it now.

Report

pepedopolous

5 years ago

Works just fine! Thanks so very much for fixing this.

Report

pepedopolous

5 years ago

Sorry for putting another feature request here. I think in the event of one of the methods not working for some setups, it would be useful to have a preview mode which would show the transition from nighttime temp to daytime temp (yes f.lux has this).
Then if there was a tooltip for the method select which would say something like 'if randr doesn't work try vidmode', users could quickly solve such problems.

Report

simgunz

5 years ago

I'll fix the tooltip (actually I didn't care about the tooltips and they are all wrong). The preview is not possible untill redshift does not implement this feature. You should ask for this on the redshift page.

Report

Mogger

5 years ago

Nice update, the activities support is flawless and works really well. Thanks for your work!

Report

t3ddy

5 years ago

I've got the impression that it doesn't really autostart.
The icon is correct, but desktop's colors are not adjusted.

Report

Mogger

5 years ago

There's an Autolaunch checkbox in settings, have you checked it? It works for me.

Report

t3ddy

5 years ago

Yes it's checked

Report

simgunz

5 years ago

I expected this kind of problem actually. I'll try to find a workaround. Here you can find an explanation.

https://github.com/simgunz/redshift-plasmoid/issues/1

Report

t3ddy

5 years ago

Using pidstat -C "redshift" -l
I get: /usr/bin/redshift -c /dev/null -l 0.0 0.0 -t 6300 5000 -g 1.00 1.00 1.00
and as you can see latitude and longitude are not set.
My longitude and latitude are 44.6 and 10.9, the plasmoid always change them to 41.9 and 12.5. I can't understand why.

Report

Hookahey

5 years ago

Same problem here. It seems to be the KConfig backend. The values written are not saved to it as a "self.config().group("General").entryMap()" reveals, after the config values have been changed.

Quote:My longitude and latitude are 44.6 and 10.9, the plasmoid always change them to 41.9 and 12.5. I can't understand why.
This happens because when the values are not in the config they are retrieved by the current system time zone.

Quote:Using pidstat -C "redshift" -l
I get: /usr/bin/redshift -c /dev/null -l 0.0 0.0 -t 6300 5000 -g 1.00 1.00 1.00
and as you can see latitude and longitude are not set.
Nevertheless, when the plasmoid retrieves the values to start redshift it uses the default return value of "0" if the config is empty with the field, so there comes the commandline arguments of "0" from.
Unfortunately did not have time to dig deeper about what causes this bug. I tried to delete the config cache and use kbuildsycoca and restart plasma but no relief so far. If not everyone has the same problems then it might be something about the KDE/Distro version. In my case it is Kubuntu 11.10 with KDE 4.8.

Bye
Hookahey

Report

simgunz

5 years ago

I have the problem,too. I've done some testing, but I can't understand where the problem come from. Programming for plasma is like doing reverse engineering!
Here are some considerations, maybe someone can give me some ideas.

PLASMOIDVIEWER

Plasmoidviewer mechanism:
When you start plasmoidviewer it copies the config values from plasmoidviewerrc to plasmoidviewer-appletsrc (all these values are overwritten).
While plasmoidviewer is running it stores the config values to plasmoidviewer-appletsrc.
When you close plasmoidviewer, it copies the config values from plasmoidviewer-appletsrc to plasmoidviewerrc.

When you load the applet with plasmoidviewer:
init() is called
configChanged() is called from init() but no config values are present
Plasmoidviewer copies the config values from plasmoidviewer-appletsrc to plasmoidviewerrc.
configChanged() is called and the config values are available

Because of this mechanism the autostart feature of redshift-plasmoid can't be tested with plasmoidviewer, but needs to be tested in plasma. Moreover the applet sets the default value of latitude and longitude everytime it is launched.

Problem (plasmoidviewer): Lost of some config values
The first time I call plasmoidviewer:
main.py set the value of latitude and longitude using writeEntry() and they are written to plasmoidviewer-appletsrc.
I edit the value of dayTemp through the configuration interface and this value is written to plasmoidviewer-appletsrc.
When I close the plasmoidviewer, only the values written with writeEntry from inside main.py are copied to plasmoidviewerrc.

Second time I run plasmoidviewer:
The config values are copied from plasmoidviewerrc to plasmoidviewer-appletsrc, so the value of dayTemp is lost.


PLASMA

When you load the applet with plasma the first time:
init() is called
configChanged() is called from init() but no config values are present
Default values of latitude and longitude are setted

Next times the applet is loaded:
init() is called
configChanged() is called from init() and get the config values

Problem (plasma):
main.py and the config dialog write their values to the same group of plasma-desktop-appletsrc, but only the values written with writEntry() from inside main.py can be read by main.py (instead the config thialog can see all the values). The other values are invisible to main.py.


Problem (for plasmoidviewer and plasma): Default values override real values
In configChanged I read the values stored:
print cfgGeneral.readEntry('latitude',5).toFloat()[0] > Result = 5
print cfgGeneral.readEntry('latitude').toFloat() > Result = (41.900001525878906, True)

But if a pair key/value is not present in the config fail the second line of code fails.

Report

t3ddy

5 years ago

C++ version seems to be ok.
It works fine here :)

Report

simgunz

5 years ago

I have the problem,too. I've done some testing, but I can't understand where the problem come from. Programming for plasma is like doing reverse engineering!
Here are some considerations, maybe someone can give me some ideas.

PLASMOIDVIEWER

Plasmoidviewer mechanism:
When you start plasmoidviewer it copies the config values from plasmoidviewerrc to plasmoidviewer-appletsrc (all these values are overwritten).
While plasmoidviewer is running it stores the config values to plasmoidviewer-appletsrc.
When you close plasmoidviewer, it copies the config values from plasmoidviewer-appletsrc to plasmoidviewerrc.

When you load the applet with plasmoidviewer:
init() is called
configChanged() is called from init() but no config values are present
Plasmoidviewer copies the config values from plasmoidviewer-appletsrc to plasmoidviewerrc.
configChanged() is called and the config values are available

Because of this mechanism the autostart feature of redshift-plasmoid can't be tested with plasmoidviewer, but needs to be tested in plasma. Moreover the applet sets the default value of latitude and longitude everytime it is launched.

Problem (plasmoidviewer): Lost of some config values
The first time I call plasmoidviewer:
main.py set the value of latitude and longitude using writeEntry() and they are written to plasmoidviewer-appletsrc.
I edit the value of dayTemp through the configuration interface and this value is written to plasmoidviewer-appletsrc.
When I close the plasmoidviewer, only the values written with writeEntry from inside main.py are copied to plasmoidviewerrc.

Second time I run plasmoidviewer:
The config values are copied from plasmoidviewerrc to plasmoidviewer-appletsrc, so the value of dayTemp is lost.


PLASMA

When you load the applet with plasma the first time:
init() is called
configChanged() is called from init() but no config values are present
Default values of latitude and longitude are setted

Next times the applet is loaded:
init() is called
configChanged() is called from init() and get the config values

Problem (plasma):
main.py and the config dialog write their values to the same group of plasma-desktop-appletsrc, but only the values written with writEntry() from inside main.py can be read by main.py (instead the config thialog can see all the values). The other values are invisible to main.py.


Problem (for plasmoidviewer and plasma): Default values override real values
In configChanged I read the values stored:
print cfgGeneral.readEntry('latitude',5).toFloat()[0] > Result = 5
print cfgGeneral.readEntry('latitude').toFloat() > Result = (41.900001525878906, True)

But if a pair key/value is not present in the config fail the second line of code fails.

Report

ls960

5 years ago

... but has no icon in kubuntu 11.10 kde 4.8.0

Report

simgunz

5 years ago

Just to be sure: have you installed redshift in addition to the plasmoid?

Are there inside this directory:
/usr/share/icons/hicolor/scalable/apps/
two icons called: redshift-status-on and redshift-status-off?
If not, there are some icons with redshift in their name?
How they are called?

Report

ls960

5 years ago

Hi, I installed redshift before plasmoid: I have no *redshift* icons.

Report

simgunz

5 years ago

Probably you need to install also gtk-redshift package, if this work let me know. In that case I'll include the icons in the plasmoid so that the gtk-redshift will not be necessary.

Report

3 years ago

1.0
Improve plasmoid status behavior
Add global shortcut to toggle redshift on/off
Add Czech translation (thanks to Pavel Fric)
Add Spanish translation (thanks to ThecaTTony)
Add doxygen comments and documentation
Code cleaning

0.6.2
Minor translation fixes

0.6.1
Add trayicon status passive when not in manual mode
Update readme with Qt5 build error solution
Fix entry name error

0.6
Add osd for manual mode
Add German translation (thanks to Matthias Mail

product-maker Lerenn Mar 09 2016

product-maker RingOV Jul 07 2015

product-maker giogziro95 Feb 19 2015

product-maker roentgen Oct 07 2014

product-maker Omega9 Sep 08 2014

product-maker jadrian Aug 25 2014

product-maker Zipristin Jul 24 2014

product-maker PVince81 Jun 24 2014

product-maker jayarmstrong Oct 28 2013

product-maker grusta May 17 2013

product-maker MatthiasM Mar 18 2013

product-maker powersack Feb 04 2013

product-maker Grobelard Aug 31 2012

product-maker skynet1248 Aug 11 2012

product-maker Deathmachine Aug 06 2012

product-maker liquidsky Jul 15 2012

product-maker addegsson Jul 13 2012

product-maker janet Jul 12 2012

product-maker pbuard Jun 06 2012

product-maker SvenArcher Jun 05 2012

product-maker pgalves Jun 02 2012

product-maker eRSZ Feb 27 2012

product-maker t3ddy Feb 07 2012

product-maker Mogger Feb 06 2012

product-maker vitoubien Feb 06 2012

product-maker dreamsoul Feb 06 2012

product-maker FraMari Feb 06 2012

product-maker 6 6

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
1.0
updated Jul 23 2014
added Feb 06 2012
downloads today
1
page views today 24