Skip to content

Instantly share code, notes, and snippets.

@tjbenator
Last active August 29, 2015 14:13
Show Gist options
  • Save tjbenator/85b61e579d4f55f7158f to your computer and use it in GitHub Desktop.
Save tjbenator/85b61e579d4f55f7158f to your computer and use it in GitHub Desktop.
For use with keybind so that you know for sure that the current wallpaper has been favorited
#!/bin/bash
#Where Variety is located
VARIETY=/opt/extras.ubuntu.com/variety/bin/variety
FAVORITES=~/.config/variety/Favorites
#Get current wallpaper's name
FAV=$(basename $($VARIETY --show-current| sed -n 2p))
#Check if the favorite already exists
if [ -f $FAVORITES/$FAV ]; then
notify-send "$(basename $FAV) is already a favorite"
else
#Set current wallpaper as favorite
$VARIETY -f > /dev/null
#Notify user that it has been favorited
notify-send "Added $(basename $FAV) to favorites"
fi
#Go to next wallpaper
$VARIETY -n > /dev/null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment