Created
May 29, 2012 22:00
-
-
Save ihashacks/2831068 to your computer and use it in GitHub Desktop.
Liferea + Unity
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 | |
# | |
# 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 |
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
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