Created
April 30, 2025 21:15
-
-
Save iwconfig/60ad99a1ddc5e6d51bec5ab708a7d5d5 to your computer and use it in GitHub Desktop.
Modified `pipx` executable for use within a Flatpak environment, setting up necessary environment variables to isolate `pipx` from the host system. Replace the content of `pipx` with `pipx-bin.py`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import re | |
import os | |
import sys | |
if __name__ == '__main__': | |
BASE_DIR = f'{os.environ['HOME']}/.var/app/com.vscodium.codium-insiders' | |
os.environ['PIPX_HOME'] = f'{BASE_DIR}/data/pipx' | |
os.environ['PIPX_BIN_DIR'] = f'{BASE_DIR}/data/python/bin' # This path is already in your PATH | |
os.environ['PIPX_MAN_DIR'] = f'{BASE_DIR}/.local/share/man' # You might need to create this path | |
from pipx.main import cli | |
sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0]) | |
sys.exit(cli()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment