Files
fn_registry/python/functions/infra/powertoys_config_path.md
T
egutierrez 9c661d605a feat(infra): auto-commit con 12 cambios
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-08 01:21:17 +02:00

1.8 KiB

name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path, notes
name kind lang domain version purity signature description tags uses_functions uses_types returns returns_optional error_type imports params output tested tests test_file_path file_path notes
powertoys_config_path function py infra 1.0.0 pure def powertoys_config_path(user: str | None = None) -> str Devuelve el path al default.json de PowerToys Keyboard Manager. Soporta WSL, Windows nativo y override via env var POWERTOYS_CONFIG.
powertoys
keyboard
windows
wsl
config
path
false
os
platform
name desc
user Nombre de usuario Windows. Si es None, lee $USER del entorno. Solo relevante en WSL.
Path absoluto al archivo default.json de PowerToys Keyboard Manager (el archivo puede no existir). false
python/functions/infra/powertoys_config_path.py Clasificada como pure por convencion del registry: sin estado mutable, determinista dado el entorno. Lee env vars ($POWERTOYS_CONFIG, $USER, $LOCALAPPDATA, $WSL_DISTRO_NAME) que se tratan como parametros implicitos del entorno — comportamiento identico al de funciones puras de configuracion. Prioridad de resolucion: (1) $POWERTOYS_CONFIG override, (2) WSL path con /mnt/c, (3) Windows nativo.

Ejemplo

from infra.powertoys_config_path import powertoys_config_path

# WSL con usuario actual
path = powertoys_config_path()
# => /mnt/c/Users/lucas/AppData/Local/Microsoft/PowerToys/Keyboard Manager/default.json

# Override explicito
import os
os.environ["POWERTOYS_CONFIG"] = "/tmp/test_powertoys.json"
path = powertoys_config_path()
# => /tmp/test_powertoys.json

Notas

Detecta WSL verificando /mnt/c y las variables WSL_DISTRO_NAME / WSLENV. En Windows nativo usa %LOCALAPPDATA%. El archivo puede no existir si PowerToys no esta instalado.