Skip to content

Instantly share code, notes, and snippets.

@koter84
Created February 7, 2017 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koter84/4b00298b8adf0d6c57a5f035a1affb7a to your computer and use it in GitHub Desktop.
Save koter84/4b00298b8adf0d6c57a5f035a1affb7a to your computer and use it in GitHub Desktop.
Updater for Gnome Shell Extension TopIcons-Plus
#!/bin/bash
# check version
prog_dir_version=$(grep \"version\" ~/.local/share/gnome-shell/extensions/TopIcons@phocean.net/metadata.json | awk '{ print $2 }' | sed s/,//g)
echo "DIR Version: $prog_dir_version"
prog_url="https://raw.githubusercontent.com/phocean/TopIcons-plus/master/metadata.json"
prog_url_version=$(curl -s $prog_url | grep \"version\" | awk '{ print $2 }' | sed s/,//g)
echo "URL Version: $prog_url_version"
# check that a current version is found
if [ "$prog_dir_version" == "" ]
then
echo "New Installation! (no old version found)"
new_install="1"
fi
# check that a new version and url are found
if [ "$prog_url" == "" ] || [ "$prog_url_version" == "" ]
then
echo "couldn't find url for new version"
exit
fi
# check current dir version with current url version
if [ "$prog_dir_version" != "$prog_url_version" ]
then
if [ "$new_install" != "1" ]
then
echo "New Version Found!"
fi
if [ -d /tmp/topiconsplus ]
then
rm -rf /tmp/topiconsplus
fi
mkdir /tmp/topiconsplus
cd /tmp/topiconsplus/
git clone git@github.com:phocean/TopIcons-plus.git
cd TopIcons-plus
make
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment