Skip to content

Instantly share code, notes, and snippets.

@un1versal
Last active July 7, 2016 19:07
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 un1versal/f00474cae9c16d3f1a51 to your computer and use it in GitHub Desktop.
Save un1versal/f00474cae9c16d3f1a51 to your computer and use it in GitHub Desktop.
wget http://git.io/vsrbz -O revamped.sh -O revamped.sh && sudo chmod 755 revamped.sh
                  ____________________    ______________  ______________________________ 
                  ___  __ \__  ____/_ |  / /__    |__   |/  /__  __ \( )__  ____/__  __ \
                  __  /_/ /_  __/  __ | / /__  /| |_  /|_/ /__  /_/ /|/__  __/  __  / / /
                  _  _, _/_  /___  __ |/ / _  ___ |  /  / / _  ____/   _  /___  _  /_/ / 
                  /_/ |_| /_____/  _____/  /_/  |_/_/  /_/  /_/        /_____/  /_____/  
                                                                       

                      | THEMES FOR CONFLUENCE SKIN FOR KODI © universal 2013-2015 |

Revamp'ed theme downloader for Confluence skin

Simple'ish bash script to download themes and copy them over to the correct path @

/usr/share/kodi/addons/skin.confluence

Any GNU/Linux or variant distro that installs Kodi's Confluence skin to the path above and can run this script will be compatible.

Usage

Download the script to you user home directory and chmod 755

wget http://git.io/vsrbz -O revamped.sh && sudo chmod 755 revamped.sh

Run script with sudo to gain privileges to copy files to /usr/share/kodi/addons/skin.confluence media, colors and background directories.

The script provides further information on what to do in skin once themes are downloaded and installed.

Thanks to:

@wsnipex for helping me out solve a couple issues and make this a more bashist for loop

License

  ___   ___  __         ____  
 / _ \ / _ \/ /  __   _|___ \ 
/ /_\// /_)/ /   \ \ / / __) |
/ /_\\/ ___/ /___  \ V / / __/ 
\____/\/   \____/   \_/ |_____|

#!/bin/bash
echo -e "author - un1versal"
echo -e "version - 1.0.1"
echo -e "script date - Sat Aug 22 12:07:21 BST 2015"
arg="$*"
rtheme="https://github.com/un1versal/revamped.themes/raw/revamp"
ltheme="/usr/share/kodi/addons/skin.confluence"
build_dir="/home/setup"
app="Kodi"
echo -e '\e[1;36m'
echo ' ____________________ ______________ ______________________________ '
echo ' ___ __ \__ ____/_ | / /__ |__ |/ /__ __ \( )__ ____/__ __ \ '
echo ' __ /_/ /_ __/ __ | / /__ /| |_ /|_/ /__ /_/ /|/__ __/ __ / / / '
echo ' _ _, _/_ /___ __ |/ / _ ___ | / / / _ ____/ _ /___ _ /_/ / '
echo ' /_/ |_| /_____/ _____/ /_/ |_/_/ /_/ /_/ /_____/ /_____/ '
echo ' '
echo -e '\e[0;32m'
echo " | themes for Confluence skin for "${app}" © universal 2013-2015 | "
echo -e '\e[0m'
echo -e " Download and install Revamp & Revamped themes for Confluence default skin.\n"'\e[1;32m'
echo -e " $(basename $0) "'\e[0m'"is compatible with Ubuntu & variants e.g. Kodibuntu"
echo -e " GNU/Linux that uses ${app}'s ${ltheme} path\n"
USAGE()
{
echo -e '\e[1;36m'" Usage: sudo "$(basename $0)" < install >\n" 1>&2
echo -e '\e[1;33m'" * install "'\e[0m'"= Downloads & installs Revamp'ed themes automatically." 1>&2
echo -e '\e[0;37m'" Run this option regularly to ensure your themes are up-to-date.\n"'\e[0m' 1>&2
}
if [ "$(id -u)" != "0" ]
then
echo -e '\e[1;31m'" Error! This script must be run with sudo\n" 1>&2
echo -e '\e[1;36m'" Usage: sudo "$(basename $0)" < install >\n" 1>&2
USAGE
echo -e '\e[0m'
exit 1
fi
GET()
{
if [ ! -d "${build_dir}" ]
then
echo -e '\e[0;33m'" Making ${build_dir}/themes and moving into it."
echo -e '\e[0m'
mkdir -p "${build_dir}" || exit 1
cd "${build_dir}" || exit 1
else
cd "${build_dir}" || exit 1
fi
themes=(
"/media/Revamp.xbt"
"/media/Revamped.xbt"
"/media/Revamp-osf.xbt"
"/media/Revamped-osf.xbt"
"/colors/Revamp.xml"
"/colors/Revamped.xml"
"/colors/Revamp-osf.xml"
"/colors/Revamped-osf.xml"
"/backgrounds/Revamp.jpg"
"/backgrounds/Revamped.jpg"
"/backgrounds/Revamp-osf.jpg"
"/backgrounds/Revamped-osf.jpg"
)
nr=${#themes[@]}
echo -e '\e[0;33m'" We have ${nr} theme files to fetch."
echo -e '\e[0m'
for f in "${themes[@]}"
do
wget -S -o wlog "$rtheme$f" -O "$ltheme$f"
ret="$?"
if [ "${ret}" -eq 0 ]
then
status="GET OK"
echo -e '\e[1;33m'" Downloading "$rtheme$f""'\e[1;32m'" ${status}"
echo -e '\e[1;35m'" Output directory is "$ltheme$f""
echo -e '\e[0m'
elif [ "${ret}" -gt 0 ]
then
status="ERROR $(grep "HTTP/1" wlog | tail -1 | awk '{ print $2 }')"
echo -e '\e[1;33m'" Downloading "$rtheme$f""'\e[1;31m'" ${status}"
echo -e '\e[1;35m'" Output directory is "$ltheme$f""
echo -e '\e[0m'
fi
done
}
case $1 in
"install" )
if [[ -d "$ltheme" ]]
then
echo -e '\e[0;32m'"\n Grabbing latest Revamp theme files from ${rtheme}${f}"
echo -e '\e[0m'
GET
echo -e '\e[1;34m'" Clearing wget logs..."
rm -f wlog
echo -e '\e[0m'
else
echo -e '\e[0;31m'" ${ltheme} Doesn't exist in this path!"
echo -e '\e[1;34m'" If you are using a confluence skin mod download the themes from http://git.io/pjQT and follow instructions...."
echo -e '\e[0m'
fi
;;
* )
USAGE
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment