From 873db61fdb41e9095affad1c02a2694905e07474 Mon Sep 17 00:00:00 2001 From: BrainwreckedTech <3752022+BrainwreckedTech@users.noreply.github.com> Date: Thu, 28 Jan 2021 14:45:07 -0500 Subject: [PATCH] Added checker script --- ckwebapp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 ckwebapp 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