2015-12-10 21:13:02 +01:00
|
|
|
#!/usr/bin/env bash
|
2015-12-30 10:46:41 +01:00
|
|
|
currentdir="$(pwd)"
|
|
|
|
rofi_themes_dir="$(dirname $0)"
|
|
|
|
|
|
|
|
cd "${rofi_themes_dir}"
|
2015-12-10 21:13:02 +01:00
|
|
|
|
|
|
|
git submodule update --init
|
|
|
|
|
2015-12-10 21:20:41 +01:00
|
|
|
# Empty file.
|
|
|
|
echo "" > README.md
|
|
|
|
|
|
|
|
# Fill it
|
2015-12-29 14:11:01 +01:00
|
|
|
echo "# Rofi Themes: " >> README.md
|
2015-12-28 20:29:03 +01:00
|
|
|
echo "Below a list of user contributed **rofi** themes." >> README.md
|
2015-12-29 14:11:01 +01:00
|
|
|
echo "" >> README.md
|
|
|
|
|
|
|
|
getAuthor() {
|
|
|
|
awk '/User: / { print $3 }' "${a}"
|
|
|
|
}
|
2015-12-28 20:32:08 +01:00
|
|
|
|
2016-11-12 18:41:23 +01:00
|
|
|
THEMES=(Themes/*.theme Themes/gruvbox/*.theme)
|
2015-12-28 20:32:08 +01:00
|
|
|
for a in ${THEMES[@]}
|
2015-12-10 21:13:02 +01:00
|
|
|
do
|
2015-12-11 16:45:13 +01:00
|
|
|
FILE=$(basename $a)
|
2015-12-29 14:11:01 +01:00
|
|
|
STRIPPED=$(grep -vwE "User:" "${a}")
|
2015-12-11 16:45:13 +01:00
|
|
|
echo "File: ${FILE}"
|
|
|
|
NAME=${FILE%.theme}
|
2015-12-11 09:08:12 +01:00
|
|
|
IMAGE="Screenshots/${NAME}.png"
|
2015-12-29 14:11:01 +01:00
|
|
|
AUTHOR=$(getAuthor)
|
|
|
|
echo "# ${FILE}" >> README.md
|
2015-12-30 10:46:41 +01:00
|
|
|
if [ ${AUTHOR} ];
|
2015-12-29 14:11:01 +01:00
|
|
|
then
|
|
|
|
echo "by ${AUTHOR}" >> README.md
|
|
|
|
fi
|
2015-12-28 20:23:37 +01:00
|
|
|
echo "" >> README.md
|
2015-12-11 09:08:12 +01:00
|
|
|
if [ ${a} -nt ${IMAGE} ]
|
|
|
|
then
|
|
|
|
./rofi/script/rofi-create-screenshot.sh "${a}" "${IMAGE}"
|
2015-12-11 09:12:11 +01:00
|
|
|
git add "${IMAGE}"
|
2015-12-11 09:08:12 +01:00
|
|
|
git add "${a}"
|
|
|
|
fi
|
2015-12-11 09:09:49 +01:00
|
|
|
echo "## Screenshot" >> README.md
|
2015-12-28 20:23:37 +01:00
|
|
|
echo "" >> README.md
|
2015-12-11 09:09:49 +01:00
|
|
|
echo "![Screenshot](./${IMAGE})" >> README.md
|
2015-12-28 20:23:37 +01:00
|
|
|
echo "" >> README.md
|
2015-12-11 09:09:49 +01:00
|
|
|
echo "## XResources" >> README.md
|
2015-12-28 20:23:37 +01:00
|
|
|
echo "" >> README.md
|
2015-12-28 20:25:22 +01:00
|
|
|
echo "~~~" >> README.md
|
2015-12-29 14:11:01 +01:00
|
|
|
echo "${STRIPPED}" >> README.md
|
2015-12-28 20:25:22 +01:00
|
|
|
echo "~~~" >> README.md
|
|
|
|
echo "" >> README.md
|
2015-12-10 21:13:02 +01:00
|
|
|
done
|
|
|
|
|
|
|
|
git add README.md
|
2015-12-30 10:46:41 +01:00
|
|
|
|
|
|
|
cd "${currentdir}"
|
|
|
|
|
|
|
|
|