mirror of
https://github.com/Kron4ek/Conty
synced 2024-12-26 09:58:38 +01:00
Export desktop files recursively
Some applications store their desktop files not just in /usr/share/applications, but in a subdirectory. Now we handle such cases too.
This commit is contained in:
parent
99de03d896
commit
850b0571e4
1 changed files with 19 additions and 12 deletions
|
@ -19,7 +19,7 @@ script_version="1.22"
|
|||
|
||||
# Important variables to manually adjust after modification!
|
||||
# Needed to avoid problems with mounting due to an incorrect offset.
|
||||
script_size=26531
|
||||
script_size=26746
|
||||
utils_size=2507588
|
||||
|
||||
# Full path to the script
|
||||
|
@ -808,7 +808,13 @@ if [ "$(ls "${mount_point}" 2>/dev/null)" ] || \
|
|||
cd "${mount_point}"/usr/share/applications || exit 1
|
||||
|
||||
echo "Exporting..."
|
||||
for f in *.desktop; do
|
||||
for f in *.desktop */ */*.desktop; do
|
||||
if [ "${f}" != "*.desktop" ] && [ "${f}" != "*/*.desktop" ] && [ "${f}" != "*/" ]; then
|
||||
if [ -d "${f}" ]; then
|
||||
mkdir -p "${applications_dir}"/"${f}"
|
||||
continue
|
||||
fi
|
||||
|
||||
while read -r line; do
|
||||
line_function="$(echo "${line}" | head -c 4)"
|
||||
|
||||
|
@ -822,6 +828,7 @@ if [ "$(ls "${mount_point}" 2>/dev/null)" ] || \
|
|||
|
||||
echo $line >> "${applications_dir}"/"${f%.desktop}"-conty.desktop
|
||||
done < "${f}"
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Desktop files have been exported"
|
||||
|
|
Loading…
Reference in a new issue