[app] improvement: adding the environment variable if not available

This commit is contained in:
Vinicius Moreira
2021-11-29 12:40:05 -03:00
parent 09c455f441
commit 046d409366
2 changed files with 5 additions and 1 deletions

View File

@@ -16,6 +16,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- custom themes: `/usr/share/bauh/themes`
- symlinks/binaries : `/usr/local/bin`
- shared files: `/usr/local/share/bauh`
- adding the `XDG_RUNTIME_DIR` environment variable if not available (following the pattern `/run/user/$UID`)
- UI
- settings panel:

View File

@@ -15,6 +15,9 @@ def main(tray: bool = False):
if not os.getenv('PYTHONUNBUFFERED'):
os.environ['PYTHONUNBUFFERED'] = '1'
if not os.getenv('XDG_RUNTIME_DIR'):
os.environ['XDG_RUNTIME_DIR'] = f'/run/user/{os.getuid()}'
faulthandler.enable()
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)