Skip to content

Commit

Permalink
export: add label none to disable labeling. Fix #993
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
  • Loading branch information
89luca89 committed Sep 26, 2023
1 parent ce97e5b commit 9b4e7ec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
8 changes: 7 additions & 1 deletion distrobox-export
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Options:
--bin/-b: absolute path of the binary to export
--delete/-d: delete exported application or binary
--export-label/-el: label to add to exported application name.
Use "none" to disable.
Defaults to (on \$container_name)
--export-path/-ep: path where to export the binary
--extra-flags/-ef: extra flags to add to the command
Expand Down Expand Up @@ -238,6 +239,11 @@ fi
container_command_prefix="${DISTROBOX_ENTER_PATH:-"distrobox-enter"} ${rootful} -n ${container_name} -- ${start_shell} "
if [ -z "${exported_app_label}" ]; then
exported_app_label=" (on ${container_name})"
elif [ "${exported_app_label}" = "none" ]; then
exported_app_label=""
else
# Add a leading space so that we can have "NAME LABEL" in the entry
exported_app_label=" ${exported_app_label}"
fi

# Print generated script from template
Expand Down Expand Up @@ -456,7 +462,7 @@ export_application() {
sed "s|\(%.*\)|${extra_flags} \1|g" |
sed "/^TryExec=.*/d" |
sed "/^DBusActivatable=true/d" |
sed "s|Name.*|& ${exported_app_label}|g" \
sed "s|Name.*|&${exported_app_label}|g" \
> "/run/host${host_home}/.local/share/applications/${desktop_home_file}"
# in the end we add the final quote we've opened in the "container_command_prefix"

Expand Down
1 change: 1 addition & 0 deletions docs/usage/distrobox-export.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ automatically be launched from the container it is exported from.
--bin/-b: absolute path of the binary to export
--delete/-d: delete exported application or binary
--export-label/-el: label to add to exported application name.
Use "none" to disable.
Defaults to (on \$container_name)
--export-path/-ep: path where to export the binary
--extra-flags/-ef: extra flags to add to the command
Expand Down

0 comments on commit 9b4e7ec

Please sign in to comment.