Dvlv / BoxBuddyRS

A Graphical Interface for Distrobox
MIT License
229 stars 24 forks source link

Add support for distrobox assemble #39

Closed VortexAcherontic closed 7 months ago

VortexAcherontic commented 7 months ago

About

While working on the volumes feature (still very WIP) I also noticed we have no support for distrobox assemble files.
Typically those are ini files containing one or more distrobox specifications.

An example could look like this:

[tumbleweed-test]
additional_packages=git bash-completion opi ffmpeg-6 gcc make cmake htop scout-command-not-found
image=tumbleweed:latest
init=true
start_now=false
nvidia=true
pull=true
root=false
replace=false
volume=/opt/datalake:/opt/datalake
volume=/etc/vulkan/:/etc/vulkan/

[rocky-test]
additional_packages=fuse fuse-libs alsa-lib apr apr-util fontconfig freetype libglvnd libglvnd-egl libglvnd-glx libglvnd-opengl libgomp librsvg2 libXcursor libXfixes libXi libXinerama libxkbcommon libxkbcommon-x11 libXrandr libXrender libXtst libXxf86vm mesa-libGLU mtdev pulseaudio-libs xcb-util xcb-util-image xcb-util-keysyms xcb-util-renderutil xcb-util-wm ocl-icd
image=quay.io/rockylinux/rockylinux:8
pull=true
replace=true
nvidia=true

[appimage-test]
additional_packages=fuse libfuse2 xcb libfontconfig1 libxcb-xkb1 libxkbcommon-x11-0 libXi6 libXrender1 libQt5WaylandClient5 libqt5-qtwayland libQt6WaylandClient6 kwayland qt6-wayland pipewire-alsa libfribidi0 libthai libXtst6
image=tumbleweed:latest
init=false
start_now=false
nvidia=true
pull=true
root=false
replace=true

With the command distrobox assemble --file /path/to/file distrobox can created one ore more distroboxes at once.

I added a new button to the header bar for the assemble feature instead of adding it to the new distrobox popup because I found the assemble feature rather different from the create feature.
This button will only show if host_access is true for flatpak users.

Bildschirmfoto vom 2024-02-03 12-24-37

Clicking this button will open up a FileDialog with a file filter for the MIME-Types: text/plain, application/textedit and application/zz-winassoc-ini

Bildschirmfoto vom 2024-02-03 12-42-33

Then a popup will shown with a status message and a spinner as long as distrobox is busy which will then auto close and trigger a re render of the main window to show the new boxes.

Bildschirmfoto vom 2024-02-03 12-42-36

Bildschirmfoto vom 2024-02-03 12-42-43

I did not yet provided any additional translations for this new feature as I plan on adding all missing translations later if more stuff was added.

Notice: The user would be able to create distrobox containers without nvidia integration this way!
But also I assume user to have those ini files do also know about the nvidia flag.

Kind regards, V.

Dvlv commented 7 months ago

Wow, this is great, thank you!

VortexAcherontic commented 7 months ago

That was fast. I was still reading my PR for spelling errors and wording issues 😆 Many thanks!

Dvlv commented 7 months ago

Was funny timing, I was just releasing 1.2.1 when this came in.

I'll release this as 1.3.0 soon, depending if I'm free tomorrow.