So I've essentially run into the same problem as in my other question: Running shell Script via Crontab
I will now run my shell script with systemd.timer but it is not working so far.
Here is my background.timer file:
[Unit] Description=Changes between backgrounds [Timer] OnUnitActiveSec=10s OnBootSec=10s Unit=background.service [Install] WantedBy=timers.target And my background.service file:
[Unit] Description=Changes between backgrounds [Service] Type=oneshot ExecStart=/home/seb/Bilder/Wallpaper/.background_skript/skript.sh And the file it should run:
#!/bin/bash night="$HOME/Bilder/Wallpaper/appa_night.jpg" day="$HOME/Bilder/Wallpaper/appa_day.jpg" H=$(date +%H) if [[ '13' < $H && $H < '20' ]] then gsettings set org.gnome.desktop.background picture-uri-dark file:///"$day" else gsettings set org.gnome.desktop.background picture-uri-dark file:///"$night" fi The bash file is also unable by myself from the terminal and my crontab had could also run it after the changes from my other question. Maby I have to do something similar in systemd?
Here is what my Crontab file looks like:
XDG_RUNTIME_DIR="/run/user/1000" 00 08 * * * systemd-run --user ~/Bilder/Wallpaper/.background_skript/skript.sh 00 20 * * * systemd-run --user ~/Bilder/Wallpaper/.background_skript/skript.sh So far the systemd.service don't run the bash file at all nor change the background.
systemd-run...manually from a shell, with the--ptyoption added? (Put aset -xat the top of your script, too.)journalctl --user -u background.servicesays and (2) how exactly you activated the timer (systemctl --user enable --now background.timer, I suppose, but just to double-check). Who owns the script? Who is allowed to run it?