diff options
| author | suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> | 2023-04-25 05:12:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-24 20:12:42 -0700 |
| commit | d6f336d84b8b00161a688d4b39b82165a3ebe1f3 (patch) | |
| tree | 6b166fa18cdde58e73ab0d4a2a1d275842e5c039 /backend/localplatformwin.py | |
| parent | 4777963b65ea9310bcdd3f56a6516cf15476e490 (diff) | |
| download | decky-loader-d6f336d84b8b00161a688d4b39b82165a3ebe1f3.tar.gz decky-loader-d6f336d84b8b00161a688d4b39b82165a3ebe1f3.zip | |
Feat/configurable paths (#404)v2.7.2-pre2
Diffstat (limited to 'backend/localplatformwin.py')
| -rw-r--r-- | backend/localplatformwin.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/backend/localplatformwin.py b/backend/localplatformwin.py index 3242403b..b6bee330 100644 --- a/backend/localplatformwin.py +++ b/backend/localplatformwin.py @@ -35,4 +35,19 @@ async def service_restart(service_name : str) -> bool: return True # Stubbed def get_username() -> str: - return os.getlogin()
\ No newline at end of file + return os.getlogin() + +def get_privileged_path() -> str: + '''On windows, privileged_path is equal to unprivileged_path''' + return get_unprivileged_path() + +def get_unprivileged_path() -> str: + path = os.getenv("UNPRIVILEGED_PATH") + + if path == None: + path = os.getenv("PRIVILEGED_PATH", os.path.join(os.path.expanduser("~"), "homebrew")) + + return path + +def get_unprivileged_user() -> str: + return os.getenv("UNPRIVILEGED_USER", os.getlogin()) |
