Gsettings with cron

前端 未结 7 1839
北恋
北恋 2020-12-05 13:48

I wrote a bash script that changes the wallpaper (for GNOME3).

#!/bin/bash

# Wallpaper\'s directory.
dir=\"${HOME}/images/wallpapers/\"

# Random wallpaper.         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-05 14:21

    To change your wallpaper through cron, just do this directly in your crontab : Execute crontab -e

    Add lines like this :

    30 09 * * * DISPLAY=:0 GSETTINGS_BACKEND=dconf /usr/bin/gsettings set org.gnome.desktop.background picture-uri file:////home/elison/Pictures/morning.jpg

    00 12 * * * DISPLAY=:0 GSETTINGS_BACKEND=dconf /usr/bin/gsettings set org.gnome.desktop.background picture-uri file:////home/elison/Pictures/noon.jpg

提交回复
热议问题