You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
445 B
13 lines
445 B
4 years ago
|
#!/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'
|