I am running Mint 13 with Cinnamon 1.6. I would like my desktop wallpaper to automatically change depending on the time of day. So, the first thing that comes to mind is setting up a cron job to do it for me. Problem is, I don't know how to change the wallpaper from script / terminal.

What I would like to know:
1) How would one change the background from terminal?
2) Is the there already a built-in way of doing this?

  • 1
    What's your DE? – daisy Dec 28 '12 at 9:30
  • @warl0ck - Cinnamon 1.6 – aggregate1166877 Dec 28 '12 at 10:04

This is the correct answer to the question. Anything else would just be a hack

 gsettings set org.cinnamon.desktop.background picture-uri  "file:///filename"
|improve this answer|||||
  • 4
    Without any explanation, this is next to useless. – vonbrand Mar 12 '14 at 1:28
  • 8
    It is the correct answer to the query. Why do you need an explanation? It is the correct way to change the wallpaper on the Cinnamon desktop. – Ramblin Man Mar 12 '14 at 10:28
  • 1
    ..and the only answer that works. +1 – aggregate1166877 May 5 '15 at 0:18

With Linux Mint 16 (not sure about other versions) you can use gsettings to both get information about your current wallpaper as well as set it.

The man gsettings is a little thin, but TAB completion will work at most steps in the following commands.

Get info:

gsettings get org.cinnamon.desktop.background picture-uri
gsettings get org.cinnamon.desktop.background picture-opacity
gsettings get org.cinnamon.desktop.background picture-options

To change any option, simply change "get" to "set" and add the new value to the end.

Here is a quick script that will cycle over a known list of wallpapers:

# Set the wallpaper from a list
# The list, all can be found in $BASE
LIST="shot1.png another.png just_no_space_in_name.png keep_adding.png"

# The current wallpaper
current=`gsettings get org.cinnamon.desktop.background picture-uri`
opacity=`gsettings get org.cinnamon.desktop.background picture-opacity`
options=`gsettings get org.cinnamon.desktop.background picture-options`

# loop over the list until we find a match
for wp in $LIST
    if [ $matched -eq 1 ]
    elif [ "'${BASE}${wp}'" = "${current}" ]

# if "$new" is blank, then we show the first shot
if [ "$new" = "" ]
    new=${BASE}${LIST%% *}

# set the wallpaper
gsettings set org.cinnamon.desktop.background picture-uri \'${new}\'
gsettings set org.cinnamon.desktop.background picture-opacity ${opacity}
gsettings set org.cinnamon.desktop.background picture-options ${options}
|improve this answer|||||

In terms of the x window system you want to change the background of the root window. The "builtin"-tool to change the settings of this window is xsetroot. Unfortunately it's a bit outdated, for instance it only supports to choose bitmaps for the background-image.

I prefer the tool hsetroot over xsetroot. Both tools must be used from the command line.

Moreover I can imagine that you can adjust settings of the root window via the x resource database but i can't find related informations by now.

|improve this answer|||||
  • hsetroot seems to be exactly what I want, but it's not setting my desktop background; instead, it sets the background of the workspaces selection when I hover over the hot corner. Any ideas? – aggregate1166877 Dec 28 '12 at 11:18

Try this:

xsetbg /path/to/wallpaper.jpg
|improve this answer|||||
  • Thanks, but it does not affect the wallpaper. It does however change the screen shown when logging out. I'm starting to think that Cinnamon treats x11 settings in a different way than other environments do. – aggregate1166877 Dec 28 '12 at 19:26
  • @user1166877: Wierd, it works for me. I've used Metacity and Openbox as window managers, but I think this is "below" that. Check out precisely what I use if that could offer a clue as to what differs. – Emanuel Berg Dec 28 '12 at 22:58

Works for me on Linuxmint 13 with Cinnamon 1.4.

  • cinnamon-settings desktop # in terminal > Untick "Let file manager handle the desktop"
  • change your wallpaper with feh
    feh --bg-fill ~/Images/my_wallpaper.png
|improve this answer|||||

There is something called DesktopNova.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.