I would like my system to automatically switch to dark mode after dusk. After some searching I came across this topic. However, I get the following when I attempt to run the commands it mentioned. No such schema “org.mate.desktop.interface”
I figure a new thread is appropriate, since this is a different version of Ubuntu MATE and possibly a different way of accomplishing this task.
The script works flawlessly when ran standalone, but fails when put into the crontab as follows: * * * * * /home/mike/Documents/Scripts/Ambiant-MATE-Dark.sh 1> /home/mike/log.txt 2> /home/mike/err.txt
It puts the following error in my log file: error: Cannot autolaunch D-Bus without X11 $DISPLAY
After googling the error message. I modified the command to be DISPLAY=:0.0 dconf write /org/mate/desktop/interface/gtk-theme "'Ambiant-MATE-Dark'"
No more errors logged, but it still doesn't work. Again, the command works perfectly in the terminal or as a standalone script but does nothing in cron.
The following command runs successfully for me in the terminal: XAUTHORITY=/home/mike/.Xauthority DISPLAY=:0.0 dconf write /org/mate/desktop/interface/gtk-theme "'Ambiant-MATE-Dark'"
However, the following entry in my crontab doesn't appear to do anything when it runs: * * * * * XAUTHORITY=/home/mike/.Xauthority DISPLAY=:0.0 dconf write /org/mate/desktop/interface/gtk-theme "'Ambiant-MATE-Dark'"
The following gets logged in /var/log/syslog every minute: Apr 11 14:40:01 mike-H97-D3H CRON[10126]: (mike) CMD (XAUTHORITY=/home/mike/.Xauthority DISPLAY=:0.0 dconf write /org/mate/desktop/interface/gtk-theme "'Ambiant-MATE-Dark'")
The following also gets logged in /var/log/syslog at odd intervals; not sure if it's related or not: Apr 11 14:40:11 mike-H97-D3H python3[1449]: Received a timestamp of 0; window activation may not function properly.
@mtnarwhal One more thing, gsettings needs a DBUS session connection to be set, add the line below to my script ... (you don't need to export XAUTH and DISPLAY, DBUS takes care of things)
Additinally to your theme switcher, you can use redshift (pre-installed on your UM). This software make the screen colors more red to avoid blue light. It is changing the gamma automaticly depending on your localisation and the day time.
My config : .config/redshift.conf