[Suggestion] Automatic profile generation for terminal emulators
Is your feature request related to a problem? Please describe.
Although not related to any specific problem I'm having, I think it would be very convenient for Distrobox to automatically create and manage terminal profiles for each container (e.g. for Konsole, GNOME Terminal, xfce-terminal, etc.), similar to the existing feature with .desktop files.
This feature would allow users to manage sessions inside their terminals more effectively, and would work to integrate better with immutable desktops.
Describe the solution you'd like
I propose adding this functionality to the distrobox-generate-entry script, which will create valid profile data for installed compatible terminals, filling out the custom icons and starting commands similarly to .desktop files.
Example behaviour
Say a Distrobox container is created, named ubuntu, using the Ubuntu image. Currently, Distrobox will create a desktop file in ~/.local/share/application/:
[Desktop Entry]
Name=Ubuntu
GenericName=Terminal entering Ubuntu
Comment=Terminal entering Ubuntu
Categories=Distrobox;System;Utility
Exec=/usr/bin/distrobox enter ubuntu
Icon=/home/jahinzee/.local/share/icons/distrobox/ubuntu.png
Keywords=distrobox;
NoDisplay=false
Terminal=true
TryExec=/usr/bin/distrobox
Type=Application
With this change, if the script detects that, say Konsole is installed on the host, Distrobox would also also create this profile in ~/.local/share/konsole:
[General]
Command=/usr/bin/distrobox enter ubuntu
Icon=/home/jahinzee/.local/share/icons/distrobox/ubuntu.png
Name=ubuntu
Parent=FALLBACK/
Describe alternatives you've considered
Instead of adding this behaviour to the existing distrobox-generate-entry script, a separate script that only created terminal profiles could be implemented, but I figured that implementing this behaviour into the existing script would be better (with perhaps options to enable/disable this feature if required), as much of the existing code for desktop files can be reused for profile files.
Additional context I'm more than happy to work on the implementation and submit a PR if this is something that might be worth doing :)
Hi @jahinzee I have this script to generate it for gnome-terminal: https://gist.github.com/89luca89/0de1c8c70f4370511320a39ca7d2785e
I'm not familiar with other terminals tbh, and I think doing this type of approach risks to become a donkey-carrot problem, always needing to update profile generation :shrug:
Hi @jahinzee! Ptyxis is a great terminal for GNOME by Red Hat engineer Christian Hergert (@chergert). It can be installed via Flatpak. It does an excellent job of giving you a "terminal workspace". I like the interface and tabs with overviews in particular. It does exactly what you're asking for more straightforwardly. The only catch may be that it is GNOME-centric.