OS installation woes
I prefer stability and thus I let my Linux LTS distributions to last almost till the entire end of support time. Having learned from previous transition periods, I started maintaining notes on what softwares I install/purge and some of the customization stuff. This has vastly reduced the pain of a fresh OS installation, but the fact remains that there'll always be some persistent and annoying trouble.
The one I encountered this time around is really perplexing and I'm afraid of trying to figure out the root cause. For now, I'm happy with the workaround I ended up with.
I use redshift
to set the color temperature of computer display. It is a simple temperature setting that doesn't depend on time or place, so my config is simple. However, it wasn't working when I moved from good old Ubuntu to Linux Mint (because Ubuntu is no longer user friendly). As per this discussion on Linux Mint forum, geoclue2
no longer works. That shouldn't matter for me since I don't need location services. Whatever, that same thread mentioned xsct as a simpler alternative that exactly fits my need (with a bonus of changing screen brightness!).
I installed it and a really really simple command from the terminal was all it needed to work. So, what was the annoying issue? I couldn't get it to autostart on login no matter what I did! At first, I thought perhaps I needed to use the full path of the command, but that obviously didn't solve my troubles. After fruitless search on the internet, I almost thought to ask a question on the forum. Before that though, I had the bright idea (really basic debugging rule) to first check if my autostart setup was working at all. I chose to autostart a terminal on login via the xfce4-terminal
command and it did work!
So, why wasn't xsct
working? No idea. But reading the man
page of the terminal emulator showed that I can choose to execute a command with the -e
option. So, that was my inelegant workaround! The desktop entry is shown below if you are curious. If you know why Exec=xsct 3500 0.9
doesn't work compared to Exec=xfce4-terminal -e 'xsct 3500 0.9'
, do let me know!
[Desktop Entry]
Encoding=UTF-8
Version=0.9.4
Type=Application
Name=displaytemperature
Comment=
Exec=xfce4-terminal -e 'xsct 3500 0.9'
OnlyShowIn=XFCE;
RunHook=0
StartupNotify=false
Terminal=false
Hidden=false
Update:
The above solution didn't work as I hoped. The screen setting would activate some of the time but most often it didn't. I resorted to creating a keyboard shortcut, which I'd use when the activation failed.
The terminal would always show up briefly on login though, which meant the issue wasn't due to the autostart failing altogether. One day I happened to notice that the screen setting would actually take effect before immediately relapsing to the normal temperature. And thus I arrived at the current solution that hasn't failed yet. I wrote a shell script that first used the sleep
command to create a delay of one second before calling xsct
. The autostart desktop entry now calls this script — again, using xfce4-terminal -e
because for some reason calling the script directly still fails 🤷.