Last active
August 29, 2015 14:13
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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