jonls / redshift

Redshift adjusts the color temperature of your screen according to your surroundings. This may help your eyes hurt less if you are working in front of the screen at night.
http://jonls.dk/redshift
GNU General Public License v3.0
5.91k stars 429 forks source link

multiple redshift-gtk and redshift processes can run at once #218

Open deutrino opened 9 years ago

deutrino commented 9 years ago

Linux Mint Xfce 17.1, 32-bit, on a Core 2 Duo iMac.

Running redshift on startup and then executing it from the menu results in two copies of redshift-gtk and redshift running for the same user. Sometimes they will "fight" and cause the screen to flicker. redshift and gtk-redshift 1.9.1.1-trusty.

Probably there should be a sanity check for this if not a limit of 1 process per user.

jonls commented 9 years ago

We can't do this just yet since some users need to run multiple Redshift instances in order to control multiple displays/screens. When Redshift can do this from one instance we should consider a check like this.

deutrino commented 9 years ago

Would it be possible to implement a check that >1 redshift process is not controlling the same physical display? I respectfully believe this is a bug rather than an enhancement, although it may require new code to do the check and refuse to start (or similar resolution).

maandree commented 9 years ago

Is this senario common? Why would you open a new instance of redshift-gtk if there is already one running, which you can readily see in the status icon tray?

It must also be considered that the instances may be running with different settings, and one may be disabled.

anarcat commented 7 years ago

I've explained the rationale behind this a little more in this Debian bug report: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860841

basically, while it's nice that it's possible to run redshift "headless" (and could be the default, shipped with properly crafted systemd files), it's still very useful to have a GUI for users to know what's going on: they can then examine the configuration and status, and also turn the thing on and off.

thank you for your consideration...

anauta commented 6 years ago

@deutrino @anarcat You can toggle it (open if closed, close if open) by assigning a keyboard shortcut to sh -c "pgrep redshift && pkill -TERM redshift || redshift-gtk"

dandv commented 3 years ago

Is this s[c]enario common?

People run into running multiple instances of Redshift accidentally, and don't realize it, then get confused:

At least a warning would help.

Also, when I run redshift-gtk as a casual Mint user, it controls all displays. So running it again with the same parameters should definitely warn, if not exit outright.

fearedbliss commented 2 years ago

@dandv Agreed. Just spent an hour debugging my script to autostart redshift and then found out the program doesn't actually have a safety check. I then checked the man page to see if there was a switch to stop executing if an existing redshift instance is found, but nothing.