diff --git a/ckwebapp b/ckwebapp new file mode 100755 index 0000000..29fb668 --- /dev/null +++ b/ckwebapp @@ -0,0 +1,13 @@ +#!/usr/bin/env sh + +while IFS= read -r -d $'\0'; do + CACHEDIR=$(grep '^Exec' "${REPLY}" | sed "s/Exec=.* --user-data-dir='\(.*\)'/\1/g" | sed "s/'.*//g") + if [ -d "${CACHEDIR}" ]; then + printf '\r\033[K%s' "${CACHEDIR}" + else + cp -r "${CACHEDIR/pwa-*/pwa-default}" "${CACHEDIR}" + printf '\r\033[KCreated %s\n' "${CACHEDIR}" + fi +done < <(find "${HOME}/.local/share/applications/pwa" -type f -name '*.desktop' -print0) + +printf '\r\033[K' \ No newline at end of file