Skip to content

Commit

Permalink
fix: add recursive copy for application's icons (#42)
Browse files Browse the repository at this point in the history
* fix: add recursive copy for application's icons

* export: add pixmaps folder to search, fix un-export

Co-authored-by: 89luca89 <[email protected]>
  • Loading branch information
alegrey91 and 89luca89 authored Dec 22, 2021
1 parent 00389b3 commit 17d0cc1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion distrobox-create
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ container_user_uid="$(id -ru)"
distrobox_entrypoint_path="$(command -v distrobox-init)"
distrobox_export_path="$(command -v distrobox-export)"
verbose=0
version="1.2.2"
version="1.2.3"

# Print usage to stdout.
# Arguments:
Expand Down
2 changes: 1 addition & 1 deletion distrobox-enter
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ container_command="$(basename "${container_command}") -l"
container_name="fedora-toolbox-35"
headless=0
verbose=0
version="1.2.2"
version="1.2.3"

# Print usage to stdout.
# Arguments:
Expand Down
17 changes: 11 additions & 6 deletions distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exported_service=""
extra_flags=""
is_sudo=""
verbose=0
version="1.2.2"
version="1.2.3"

# We depend on some commands, let's be sure we have them
base_dependencies="basename grep sed find"
Expand Down Expand Up @@ -302,7 +302,7 @@ export_application() {

# Find desktop file for the application to export
desktop_files=$(grep -ril "${exported_app}" /usr/share/applications/* || :)
icon_files=$(find /usr/share/icons -iname "*${exported_app}*" || :)
icon_files=$(find /usr/share/icons /usr/share/pixmaps -iname "*${exported_app}*" || :)
# Check that we found some desktop files first.
if [ -z "${desktop_files}" ]; then
printf >&2 "Error: cannot find any desktop files.\n"
Expand All @@ -322,11 +322,11 @@ export_application() {
# check if we're exporting or deleting
if [ "${exported_delete}" -ne 0 ]; then
# we need to remove, not export
rm -f "${icon_home_directory}"/"$(basename "${icon_file}")"
rm -rf "${icon_home_directory:?}"/"$(basename "${icon_file:?}")"
else
# we wanto to export the application's icons
mkdir -p "${icon_home_directory}"
cp "${icon_file}" "${icon_home_directory}"
cp -r "${icon_file}" "${icon_home_directory}"
fi
done

Expand Down Expand Up @@ -355,8 +355,13 @@ export_application() {
fi
done

printf "Application %s successfully exported.\nOK!\n" "${exported_app}"
printf "%s will appear in your applications list in a few seconds.\n" "${exported_app}"
if [ "${exported_delete}" -ne 0 ]; then
printf "Application %s successfully un-exported.\nOK!\n" "${exported_app}"
printf "%s will disappear from your applications list in a few seconds.\n" "${exported_app}"
else
printf "Application %s successfully exported.\nOK!\n" "${exported_app}"
printf "%s will appear in your applications list in a few seconds.\n" "${exported_app}"
fi

}

Expand Down
2 changes: 1 addition & 1 deletion distrobox-init
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ trap '[ "$?" -ne 0 ] && printf "Error: An error occurred\n"' EXIT

# Defaults
verbose=0
version="1.2.2"
version="1.2.3"

# Print usage to stdout.
# Arguments:
Expand Down

0 comments on commit 17d0cc1

Please sign in to comment.