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

[toolbox-export] utilize the container name by default #8

Open
Aman9das opened this issue Jul 27, 2023 · 0 comments
Open

[toolbox-export] utilize the container name by default #8

Aman9das opened this issue Jul 27, 2023 · 0 comments

Comments

@Aman9das
Copy link

Aman9das commented Jul 27, 2023

Right now, when running toolbox-export program inside a named toolbox, the generated .desktop entries do not work. The user needs to specify the container name using the -c argument.

I suggest toolbox-export does use the container name by default (since it runs only inside the toolbox).

Here is a python function to extract and return the container name:

import re

def get_toolbox_name():
	with open ('/run/.containerenv', 'rt') as containerenv:
		containerenv_data = containerenv.read().splitlines()
	toolbox_name_line = containerenv_data[1]
	toolbox_name = re.findall(r'"([^"]*)"', toolbox_name_line)[0]
	return toolbox_name

if __name__ == "__main__":
	toolbox_name = get_toolbox_name()
	print(toolbox_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant