rofi-themes/install.sh

36 lines
885 B
Bash
Raw Normal View History

2018-02-15 16:19:25 +01:00
#!/usr/bin/env bash
2020-01-01 15:21:58 +01:00
xdg=${XDG_DATA_HOME:-${HOME}/.local/share}
2020-01-02 09:25:24 +01:00
DIRECTORY="${xdg}/rofi/themes/"
2018-02-15 16:19:25 +01:00
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