if you’re interested in setting the wallpaper on Nemo without going through Unity Control Center, just add this script:
#!/bin/bash
fn=$1
pwd=`pwd`
picture="$pwd/$fn"
gsettings set org.gnome.desktop.background picture-uri "\"file://$picture\""
Just wish I could figure out how to enable that script only for image files.
Edit: Figured it out…kinda. Best I can make it do is open Unity Control Center if the extension isn’t valid
#!/bin/bash
img_in_arr() {
local img_ext_arr=("jpg","png")
local img_ext=$1
local state=1
for i in "${img_ext_arr[@]}"; do
if [[ $img_ext == $i ]]; then
state=0
break
fi
done
return $state
}
fn=$1
ext=`echo $fn | rev | cut -f1 -d"." -s | rev`
if [ -z "$ext" ]; then
state=1
else
state=img_in_arr $ext
fi
if [[ $state -eq 1 ]]; then
unity-control-center appearance
else
pwd=`pwd`
picture="$pwd/$fn"
gsettings set org.gnome.desktop.background picture-uri "\"file://$picture\""
fi
Just gonna fix it to make sure that it works with an uppercase extensions as well.