2018-02-15 16:19:25 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-06-14 11:04:00 +02:00
|
|
|
xdg="${XDG_DATA_HOME:-${HOME}/.local/share}"
|
|
|
|
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
|
2019-06-14 11:04:00 +02:00
|
|
|
for themefile in **/*.rasi
|
2018-02-15 16:19:25 +01:00
|
|
|
do
|
2019-06-14 11:04:00 +02:00
|
|
|
if [ -f "${DIRECTORY}/${themefile##*/}" ] && [ ${ia} -eq 0 ]
|
2018-02-15 16:19:25 +01:00
|
|
|
then
|
2019-06-14 11:04:00 +02:00
|
|
|
echo -n "Theme '${DIRECTORY}/${themefile##*/}' exists, overwrite? y/N/a(ll) "
|
2018-02-15 16:19:25 +01:00
|
|
|
read answer
|
2019-06-14 11:04:00 +02:00
|
|
|
if [ "x$answer" = x"y" ]
|
2018-02-15 16:19:25 +01:00
|
|
|
then
|
|
|
|
echo "+Installing '${themefile}'"
|
2019-06-14 11:04:00 +02:00
|
|
|
install -m 644 "${themefile}" "${DIRECTORY}"
|
|
|
|
elif [ "x${answer}" = x"a" ]
|
2018-02-15 16:19:25 +01:00
|
|
|
then
|
|
|
|
ia=1
|
|
|
|
echo "+Installing '${themefile}'"
|
2019-06-14 11:04:00 +02:00
|
|
|
install -m 644 "${themefile}" "${DIRECTORY}"
|
2018-02-15 16:19:25 +01:00
|
|
|
else
|
|
|
|
echo "+Skipping ${themefile}"
|
2019-06-14 11:04:00 +02:00
|
|
|
fi
|
2018-02-15 16:19:25 +01:00
|
|
|
else
|
2019-06-14 11:04:00 +02:00
|
|
|
echo "+Installing '${themefile}'"
|
|
|
|
install -m 644 "${themefile}" "${DIRECTORY}"
|
2018-02-15 16:19:25 +01:00
|
|
|
fi
|
|
|
|
done
|