-
Notifications
You must be signed in to change notification settings - Fork 49
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
Cannot create a desktop menu entry when installed using pipx #1465
Comments
Thanks for reporting this. I will look into this eventually. Pipx seems like a good way to install and run Porcupine, if you already have pipx installed, so I want it to be a "just works" experience. |
Here's an idea: using If it's not in the path, then error out with the messagebox. Otherwise, if a virtual environment exists, use the current logic. If there's no virtual environment, then create the desktop entry with the Exec= line as just "Exec=porcu". (EDIT: my project needed the full location here, not just the command name.) Some pseudocode: location = shutil.which('porcu')
if location is None:
# error out
venv = os.environ.get("VIRTUAL_ENV")
if venv:
# build exec_line as before
activate_path = ...
bash_command = f'source {shlex.quote(str(activate_path))} && {EXECUTABLE} "$@"'
exec_line = f"Exec=bash -c {shlex.quote(bash_command)} bash %F\n"
else:
exec_line=f"Exec={location}"
# write file as before This seems to work for my project when I install it with pipx. |
The problem is that |
Related: #1219 |
I installed Porcupine using pipx, and when checking the box in Settings to show Porcupine in the desktop menu system, I get the error messagebox: "Porcupine must be installed in a virtual environment in order to create a desktop menu entry".
Installation process:
pipx install https://github.com/Akuli/porcupine/archive/v2024.03.09.zip
pipx doesn't use the environment variable VIRTUAL_ENV, but instead creates soft links in $HOME/.local/bin that point to its internally-managed venvs. This appears to be why the action fails.
The text was updated successfully, but these errors were encountered: