This problem I can’t solve for several days. Studied systemd, service units, archwiki, examples, blog posts, forum posts on various forums… tried removing and reinstalling redshift, tried different commands with different options, different service files, nothing helps… What am I doing wrong?
The problem is to start redshift as service unit for systemd: to set the same color temperature for day and night and start redshift on login/startup
This is the service file located at /etc/systemd/system/redshift.service
[Unit]
Description=Redshift display colour temperature adjustment
Documentation=http://jonls.dk/redshift/
After=display-manager.service
systemctl daemon-reload systemctl start redshift.service --now systemctl enable redshift.service --now
Created symlink /etc/systemd/system/graphical-session.target.wants/redshift.service → /etc/systemd/system/redshift.service.
Unit /etc/systemd/system/redshift.service is added as a dependency to a non-existent unit graphical-session.target. systemctl status redshift.service
× redshift.service - Redshift display colour temperature adjustment
Loaded: loaded (/etc/systemd/system/redshift.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2022-04-20 14:59:30 MSK; 23s ago
Docs: http://jonls.dk/redshift/
Process: 7308 ExecStart=/usr/bin/redshift (code=exited, status=1/FAILURE)
Main PID: 7308 (code=exited, status=1/FAILURE)
CPU: 3ms
systemd[1]: redshift.service: Scheduled restart job, restart counter is at 5.
systemd[1]: Stopped Redshift display colour temperature adjustment.
systemd[1]: redshift.service: Start request repeated too quickly.
systemd[1]: redshift.service: Failed with result ‘exit-code’.
systemd[1]: Failed to start Redshift display colour temperature adjustment.
I specifically wanted to do it without gtk app for the following reason:
When I start gtk app it starts a wheel image spinning near the mouse cursor for half a minute. It’s pretty annoying when an app that simply controls color temperature takes 30 seconds to load…
I installed redshift like this: sudo pacman -S redshift
I did not install redshift-gtk, but somehow it still managed to creep in, I don’t know how.
I created the service file in /etc/systemd/system/redshift.service, according to examples suggested in various tutorials. Tried many versions of service files with different options, none of them worked.
I just tested and can confirm this behavior. There actually is a spinning wheel image, but only if you hover over the panel for those ~13 seconds. I have never actively seen this so I’m just going to ignore this from now on.
But you could try redshift-qt-git from the AUR which is a
redshift-gtk rewrite with C++/Qt. Currently mimicks 1:1 redshift-gtk tray menu and it’s features:
sudo pacman -S geoclue2 - that and enabling on start (and then rebooting) results in no spinning wheel - the spin is working out the location for redshift.
and if you don’t move around time zones with your lappy, the real easy option for location/colour temp etc is just put the parameters in the startup line command, something like this: redshift-gtk -t 6500:4800 -l 9.58:8.40
t being temperature (day/night), and l for latitude and longitude. Deifinately no spinning wheels with this one as no attempt to get a location from elsewhere!
well, it is and it should be, but it doesn’t. However, i just checked a fresh install of endos, and geoclue is installed by default (for gnome at least), even before redshift is installed (on deb/arch etc, i’ve always had to explicitly add it before (same went for artix the other day). So good on endos if its already there by default! A well oiled machine.
This thread brings back my experience with doing the same and similar frustrations - redshift via systemd.
I think I got redshift to work in systemd as a service, but I had to put all the configs as command-line parameters on the ExecStart line after the binary: -l nn.nn:nn.nn -m randr -P -t nnnn:nnnn -v -g 0.8
I think if you pass in your lat/long, then geoclue won’t get called. I think.
At that point, I decided it’d be easier to manage and put redshift in the cool_autostart patch of dwm along with some other apps and killed the redshift service that I had heavily modified during my debugging.
Replace n’s with your lat/long and desired color temperatures.
Hey. The Autostart function in the Context menu Redshift requires the following dependencies: python-gobject and python-xdg (python-pyxdg). One day when I was about to turn on the autostart option in Redshift, it didn’t appear in the Redshift context menu after I finished reinstalling. Turns out after I investigated it needed dependancy: python-pyxdg. Then the autostart option in the Context menu appears in Redshift.