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] Automatic profile generation for terminal emulators #1432

Open
jahinzee opened this issue Jun 5, 2024 · 1 comment
Open

[Suggestion] Automatic profile generation for terminal emulators #1432

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

Comments

@jahinzee
Copy link

jahinzee commented Jun 5, 2024

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 :)

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

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 🤷

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