Skip to content

Instantly share code, notes, and snippets.

@ihashacks
Created May 29, 2012 22:00
Show Gist options
  • Save ihashacks/2831068 to your computer and use it in GitHub Desktop.
Save ihashacks/2831068 to your computer and use it in GitHub Desktop.
Liferea + Unity
#!/bin/bash
#
# Created 20110816 by Brandon Pierce
#
# Adds new feed to Lifera using Zenity. Intended to be called as a
# Unity Launcher quick list. Pretty useless otherwise
#
LIFEREA="/usr/bin/liferea -a"
ZENITY="/usr/bin/zenity"
WGET="/usr/bin/wget -O /dev/null -q"
feederror() {
$ZENITY --error --text="There was an unknown error adding the feed to Liferea."
exit 3
}
feedadd() {
$LIFEREA $FEEDURL
if [ $? -gt 1 ]; then
feederror
else
exit 0
fi
}
feedtest() {
$WGET $FEEDURL
if [ $? -gt 0 ]; then
$ZENITY --error --text="Unable to download feed from \n\n$FEEDURL"
exit 2
else
feedadd
fi
}
FEEDURL=`zenity --entry --title="Add New Feed" --text="Feed URL:" \
--entry-text="http://example.com/feed.xml"`
if [ $? -gt 0 ]; then
exit 1
else
feedtest
fi
X-Ayatana-Desktop-Shortcuts=UpdateAll;AddNewFeed;
[UpdateAll Shortcut Group]
Name=Update All
Exec=dbus-send --session --print-reply --dest=org.gnome.feed.Reader /org/gnome/feed/Reader org.gnome.feed.Reader.Refresh
TargetEnvironment=Unity
[AddNewFeed Shortcut Group]
Name=Add New Feed
Exec=/home/brandon/.local/bin/liferea-addnewfeed.sh
TargetEnvironment=Unity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment