awesome-wm-widgets/update_from_master.sh

20 lines
707 B
Bash
Raw Normal View History

#!/usr/bin/env bash
master_dir="$HOME/.config/awesome/awesome-wm-widgets/"
pages_dir="$HOME/home-dev/awesome-wm-widgets/"
cd ${master_dir}
for D in *; do
if [[ -d "${D}" ]] && [[ ${D} == *"-widget"* ]]; then
echo "${D}"
cp ${D}/README.md ${pages_dir}/_widgets/${D}.md
sed -i '1s/^/---\nlayout: page\n---\n/' ${pages_dir}/_widgets/${D}.md
mkdir -p ${pages_dir}/assets/img/screenshots/${D}
2020-09-13 03:01:39 +02:00
2020-11-15 03:26:34 +01:00
find ${D}/ \( -name '*.jpg' -o -name '*.png' -o -name '*.gif' \) -exec cp '{}' ${pages_dir}/assets/img/screenshots/${D} \;
2020-09-13 03:01:39 +02:00
2020-11-15 03:26:34 +01:00
sed -i "s/](\.\(\/screenshots\)\{0,1\}/](..\/awesome-wm-widgets\/assets\/img\/screenshots\/$D/g" ${pages_dir}/_widgets/${D}.md
fi
done