From abeb18eee6ac24e04abffe9313ceeebef7ac99c6 Mon Sep 17 00:00:00 2001 From: Dave Davenport Date: Thu, 15 Feb 2018 16:19:25 +0100 Subject: [PATCH] Small install script. --- install.sh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100755 install.sh diff --git a/install.sh b/install.sh new file mode 100755 index 0000000..69f4b85 --- /dev/null +++ b/install.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash + +DIRECTORY=${HOME}/.local/share/rofi/themes/ + +if [ ! -d "${DIRECTORY}" ] +then + echo "Creating theme directory: ${DIRECTORY}" + mkdir -p "${DIRECTORY}" +fi + +declare -i ia=0 +for themefile in **/*.rasi +do + if [ -f "${themefile}" ] && [ ${ia} -eq 0 ] + then + echo "Theme '${themefile}' exists, overwrite? y/N/a(ll)" + read answer + if [ x$answer = x"y" ] + then + echo "+Installing '${themefile}'" + install "${themefile}" "${DIRECTORY}" + elif [ x${answer} = x"a" ] + then + ia=1 + echo "+Installing '${themefile}'" + install "${themefile}" "${DIRECTORY}" + else + echo "+Skipping ${themefile}" + fi + else + echo "+Installing '${themefile}'" + install "${themefile}" "${DIRECTORY}" + fi +done