My crontab is like as follows (I am trying to change my GNOME theme)
crontab -l
0 5 * * * /usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adapta'
30 21 * * * /usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adapta-Nokto'
Also, I created this file
echo $USER
nikhil
cat /etc/cron.allow
nikhil
When I run the command as mentioned in crontab, both of those work.
Could you please tell if I missed out some step?
Edit:
I created a script file, which I execute with cron:
export TERM=xterm-256color
TimeHr=$(date +%H)
if ((${TimeHr}>18 || ${TimeHr}<5)); then
#if [${TimeHr} -gt 11 || ${TimeHr} -lt 5]; then
mkdir ${HOME}/Documents/TestNight
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adapta'
else
mkdir ${HOME}/Documents/TestDay
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Adapta-Nokto'
fi
This is crontab
$ crontab -l
36 5,19,23 * * * bash /home/nikhil/GnomeThemeChange
@reboot bash /home/nikhil/GnomeThemeChange
cron does work as it is able to create Test Folders. But, what should I do to run gsettings inside cron?