feat(infra): auto-commit con 12 cambios

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-08 01:21:17 +02:00
parent c9bb356ffe
commit 1ffedbf48d
12 changed files with 716 additions and 0 deletions
@@ -0,0 +1,53 @@
---
name: powertoys_shortcut_remove
kind: function
lang: py
domain: infra
version: "1.0.0"
purity: impure
signature: "def powertoys_shortcut_remove(keys: list[str], config_path: str | None = None) -> bool"
description: "Elimina un atajo global del config de PowerToys Keyboard Manager por combinacion de teclas. Devuelve True si se elimino, False si no existia."
tags: [powertoys, keyboard, windows, wsl, shortcut, config, write, remove, delete]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: "error_py_core"
imports: [json, os]
params:
- name: keys
desc: "Lista de nombres de teclas (case-insensitive) que identifican el atajo a eliminar. Debe coincidir exactamente con las teclas usadas al crear el atajo. Ej: ['lctrl', 'lalt', 't']."
- name: config_path
desc: "Path al default.json. Si None, usa $POWERTOYS_CONFIG o el path WSL por defecto para $USER."
output: "True si se encontro y elimino el atajo, False si no existia ninguna entrada con esas teclas."
tested: false
tests: []
test_file_path: ""
file_path: "python/functions/infra/powertoys_shortcut_remove.py"
notes: |
error_py_core no existe en el registry. Esta funcion lanza excepciones nativas de Python:
FileNotFoundError si config_path no existe, json.JSONDecodeError si el JSON es invalido,
ValueError si un nombre de tecla no esta en VK_CODES.
La coincidencia se hace contra el string originalKeys canonico (semicolon-separated VK codes).
Si las teclas se pasaron en un orden diferente al guardado, no coincidiran — el orden importa.
El JSON se escribe en formato compacto (separators=(",", ":")) sin espacios ni saltos de linea.
---
## Ejemplo
```python
from infra.powertoys_shortcut_remove import powertoys_shortcut_remove
removed = powertoys_shortcut_remove(["lctrl", "lalt", "t"])
if removed:
print("Atajo eliminado correctamente")
else:
print("El atajo no existia")
```
## Notas
Despues de modificar el config, PowerToys necesita reiniciarse para detectar los cambios.
Usar `powertoys_restart_py_infra` para recargar la configuracion automaticamente.