From 17d0cc13991571940b9da9cb79e1a7dbfe0915d5 Mon Sep 17 00:00:00 2001 From: Alessio Greggi Date: Wed, 22 Dec 2021 09:40:53 +0100 Subject: [PATCH] fix: add recursive copy for application's icons (#42) * fix: add recursive copy for application's icons * export: add pixmaps folder to search, fix un-export Co-authored-by: 89luca89 --- distrobox-create | 2 +- distrobox-enter | 2 +- distrobox-export | 17 +++++++++++------ distrobox-init | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/distrobox-create b/distrobox-create index 1ff7013573..eca9ed4136 100755 --- a/distrobox-create +++ b/distrobox-create @@ -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: diff --git a/distrobox-enter b/distrobox-enter index 5574389c01..7ef855bfbc 100755 --- a/distrobox-enter +++ b/distrobox-enter @@ -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: diff --git a/distrobox-export b/distrobox-export index 72af416cb0..a398ebd497 100755 --- a/distrobox-export +++ b/distrobox-export @@ -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" @@ -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" @@ -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 @@ -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 } diff --git a/distrobox-init b/distrobox-init index 3d7b22ce2a..17b3a87487 100755 --- a/distrobox-init +++ b/distrobox-init @@ -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: