Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Add option in .desktop file to remove/upgrade an existing container #1433

Closed
aguslr opened this issue Jun 5, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@aguslr
Copy link

aguslr commented Jun 5, 2024

Currently there is no graphical way to remove an existing container. It can be launched from the applications menu, but it cannot be removed. So it'd be nice to have an entry in the application menu to remove the container.

This patch would add such an entry to generated .desktop files:

diff --git a/distrobox-generate-entry b/distrobox-generate-entry
index 5191829..c05bd9c 100755
--- a/distrobox-generate-entry
+++ b/distrobox-generate-entry
@@ -360,4 +360,22 @@ NoDisplay=false
 Terminal=true
 TryExec=${distrobox_path}/distrobox
 Type=Application
+Actions=Remove;
+
+[Desktop Action Remove]
+Name=Remove ${entry_name} from system
+Exec=${distrobox_path}/distrobox rm ${extra_flags} --force ${container_name}
+Name[ast]=Desaniciar ${entry_name} del sistema
+Name[cs]=Odebrat ${entry_name} ze systému
+Name[de]=${entry_name} vom System entfernen
+Name[en]=Remove ${entry_name} from system
+Name[es]=Eliminar ${entry_name} del Sistema
+Name[fr]=Supprimer l'${entry_name} du système
+Name[it]=Rimuovi ${entry_name} dal sistema
+Name[nl]=${entry_name} deïnstalleren
+Name[pl]=Usuń ${entry_name} z systemu
+Name[pt]=Remover ${entry_name} do sistema
+Name[pt_PT]=Remover ${entry_name} do sistema
+Name[ru]=Удалить ${entry_name} из системы
+Name[zh_Hans]=从系统中移除 ${entry_name}
 EOF

However, if we add --force there is no confirmation or undo option and if we don't add it, it won't remove a running container.

I wonder if there could be a nice way to ask the user for confirmation or to provide an undo alternative.

@aguslr aguslr added the enhancement New feature or request label Jun 5, 2024
@89luca89
Copy link
Owner

That's a great idea, thanks :) I've implemented it :)

Modified distrobox-rm to actually ask to force-delete in case of running containers, so that we have some interactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants