Variety is one of the best wallpaper changers from Peter Levi. Normally it just works out of the box on many known desktop environments. Since it did not work under i3 windows manager, I dived into the code and found an easy and quick fix to solve the issue.

Quick and dirty solution

All you need to do is change this code

# i3-wm/Feh. Use Feh only for i3, as it may cause problems with Nautilus, (see bug https://bugs.launchpad.net/variety/+bug/1047083)
if [ "$XDG_CURRENT_DESKTOP" == "i3" ]; then
   feh --bg-fill "$WP" 2> /dev/null
fi

into this code

# i3-wm/Feh. Use Feh only for i3, as it may cause problems with Nautilus, (see bug https://bugs.launchpad.net/variety/+bug/1047083)
#if [ "$XDG_CURRENT_DESKTOP" == "i3" ]; then
   feh --bg-fill "$WP" 2> /dev/null
#fi

Beware the “#” before two of the lines, meaning these codes will not be seen as program code and will not be executed.

Change the above code in the file “set_wallpaper” situated normally in

~/.config/variety/scripts

 

‘Cleaner’ solution

I wondered why it did not find “XDG_CURRENT_DESKTOP” variable.

Asking in the terminal for all environment variables with env  I got :

env | grep "XDG"
XDG_VTNR=7
XDG_SESSION_ID=c4
XDG_SESSION_COOKIE=0ffb1b9ec5b53a20c4bd326c567bb731-1452281350.191768-1075685128
XDG_CONFIG_DIRS=/etc/xdg/xdg-i3:/etc/xdg
XDG_SEAT=seat0
XDG_SESSION_DESKTOP=i3
XDG_DATA_DIRS=/usr/share/i3:/usr/local/share/:/usr/share/:/usr/share/mdm/
XDG_RUNTIME_DIR=/run/user/1000

Change this code

# i3-wm/Feh. Use Feh only for i3, as it may cause problems with Nautilus, (see bug https://bugs.launchpad.net/variety/+bug/1047083)
if [ "$XDG_CURRENT_DESKTOP" == "i3" ]; then
   feh --bg-fill "$WP" 2> /dev/null
fi

into this code

# i3-wm/Feh. Use Feh only for i3, as it may cause problems with Nautilus, (see bug https://bugs.launchpad.net/variety/+bug/1047083)
if [ "$XDG_SESSION_DESKTOP" == "i3" ]; then
   feh --bg-fill "$WP" 2> /dev/null
fi

$XDG_SESSION_DESKTOP is the correct variable !!

Result

linux-mint-17.3-i3-variety-settings

If you rather see what you need to do then here is a movie.

 

Pin It on Pinterest