Skip to content

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

@Aman9das

Description

@Aman9das

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions