I have had a weird issue with XFCE for... I think probably for year or so, in that the Redshift icon would appear twice in the panel. I should have grabbed a screenshot, but the issue is fixed now, and the issue only happened every few weeks or so, even if I unfix it, it might be a long time before I could get one. Please imagine a screenshot of two Redshift icons in the XFCE panel in the space below..
The duplicate icons finally annoyed my CDO (that's OCD, but alphabetised!) to the point where I decided to look for a fix.
I used Google AI mode, which I find to be quite useful in that it has read all the forum posts, Github/Gitlab, Reddit, Stack Overflow, Superuser etc comments, and, if you have half an idea what you're looking for anyway, sometimes comes up with an answer you have missed before.
Which it did in this case.
The duplicate icon bug is very common with redshift-gtk on Xfce. Because redshift-gtk supports both the legacy GtkStatusIcon tray protocol and modern AppIndicators, the unified Xfce Status Tray Plugin intercepts both hooks at startup and draws two separate lightbulb icons next to each other. (Gitlab - Gnome).
In my case, the icons were not actually next to each other (which is where a screenshot would have been useful). I don't think I would have found that link with a normal search, because it actually relates to Evolution in Gnome.
As my issue was only very occasional, I suspect that the Status Tray Plugin gets its knickers in a twist during the login process from time to time.
The first fix offered was to hide the duplicate icon. A quick check in Status Tray Plugin settings showed that Redshift does appear in both Status Notifiers and Systray Icons, which I assume correspond to the legacy and modern protocols. The legacy icon can indeed be hidden by ticking the box in Systray icons.
From experience with panel icon issues (mostly with panels in script-based window managers like Openbox and IceWM), I suspected that adding a delay to the application launch might fix the issue, by avoiding the period early in login, when conflicts happen. (Google AI says "Redshift loads before Xfce finishes mapping out its D-Bus system tray interfaces", which is beyond my pay grade. "Gets its knickers in a twist" seems like a reasonable non-technical interpretation to me.)
The solution suggested is to add the following to the autostart command for Redshift, which will cause the application to wait 5 seconds before launching.
sh -c "sleep 5 && redshift-gtk"
A similar command is suggested on the XFCE forum for a similar issue. There are differences in the format of the script used, again beyond my pay grade. I tried the AI suggestion, but as the issue was intermittent, I will have to wait and see if it worked.


