1

I wanted to create an option in the context menu to set the clicked picture to current desktop background (just like in Windows).
I read the the nautilus action help but I couldn't figure it out. This is by far the command I could craft: gsettings set org.gnome.desktop.background picture-uri file://$PWD/

What I need:

  • A command that correctly sets the current image to be the desktop background
  • This command should only appear to the proper files (picture extenstions like .jpg)

EDIT: After v2r answer and this comment , I would like to put more details.
I basically want to refer to "current directory path" and "current file clicked". for "current directory path" I used $PWD (is this the right way ?). I don't know what to use for "current file clicked" but it would be certainly after the path (e.g. $PWD/PIC_NAME.jpg).
The condition of associating this action with pictures (e.g .jpg/.png) is not important now, but I am sure it can be done from Nautilus-action.

2 Answers 2

1

The script that @v2r provided uses gconf, I modified it to work on Gnome 3 based desktops, so I used the modern gsettings.
In fact, I found the script in the Disabled scripts in Ubuntu tweak, so if you are on Gnome 2 you can go there and use it.

As for Nautilus Actions, I figured out how to type the command correctly and how to show it only for pictures. I can't export the action due to a crash, but if someone is interested you can reply here and I'll edit this post.

Script: http://pastebin.com/S6TBvrax
Instructions, description, installation can be found inside.

Note: to Identify your Gnome version, type in terminal gnome-session --version

1
  • I see you already found a solution. Well done!
    – v2r
    Aug 22, 2014 at 15:47
0

You can try this script I uploaded to pastebin, called "set-as-wallpaper". Copy the script content into a text file and save it under:

~/.gnome2/nautilus-scripts/CUSTOMFOLDER/set-as-wallpaper

If you don't already have a folder called nautilus-scripts under ~/.gnome2 manually create it, then copy the script there and make it executable like this:

chmod +x ~/.gnome2/nautilus-scripts/CUSTOMFOLDER/set-as-wallpaper

The script will be available through your context menu [right-click] - see screenshot:

enter image description here

  • As you can see see in the "Wallpaper Options" window you can choose the appropriate setting yourself.

  • About.jpg-format: Why not simply use the script on .jpg-wallpapers, or convert other image formats to .jpg, then use the "set-as-wallpaper" script.

There are also quite a lot of conversation-scripts available: see here

6
  • No, it doesn't work. My guess is gsettings should be used instead of gconftool to properly set the wallpaper.I am on Unity, if that helps. By the way, if you find the script with the gsettings command above I would appreciate it.
    – egy
    Aug 19, 2014 at 7:59
  • Another thing to note: In the gconf.xml, the path of the picture is set correctly to the desired one. Also, the "Wallpaper Options" dialog appears after clicking on the script, which means script is executed.
    – egy
    Aug 19, 2014 at 8:27
  • Regarding your first comment: What exactly does not work? I also looked through my scripts, but couldn't find one that usesgsettings sadly. I guess there is no/not an easy way around the second request.
    – v2r
    Aug 19, 2014 at 11:47
  • The wallpaper doesn't change although the script works. Thank you for your answer anyway. I guess gcong will not work since I am on Gnome 3 and gsettings had replaced gconf.
    – egy
    Aug 19, 2014 at 12:54
  • I see. Thank you for your reply. I might need some time, but I'll look up some other script alternative, that eventually might do the trick for you
    – v2r
    Aug 19, 2014 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .