feat(app-binding): lier les presets aux applications

Ajoute la configuration des associations application/preset, le service de suivi du focus, l'intégration GUI et les fichiers d'installation nécessaires.

Ajoute les tests unitaires ciblés des bindings, du service de focus, des migrations et des composants GUI associés.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-19 23:52:34 +02:00
parent 0ab77d2a64
commit 9ef2c1439c
42 changed files with 4353 additions and 12 deletions

View File

@ -21,6 +21,7 @@ import re
from dataclasses import dataclass
from typing import Dict, Tuple, Optional, Callable
from inputremapper.configs.app_binding import AppBinding
from inputremapper.configs.input_config import InputCombination
from inputremapper.configs.mapping import MappingData
from inputremapper.gui.messages.message_types import (
@ -124,3 +125,31 @@ class DoStackSwitch:
message_type = MessageType.do_stack_switch
page_index: int
@dataclass(frozen=True)
class AppBindingsData:
"""Message with the current focus-driven application bindings and service state.
``backend`` is the name of the focus backend reported by the focus-service
(e.g. "xorg", "sway", "hyprland", "wlr-foreign-toplevel"). ``supported`` is
False when the service is reachable but reports no usable backend (e.g. on
GNOME-Wayland). ``reachable`` is False when the focus-service is not running
yet, in which case the backend state is simply unknown.
"""
message_type = MessageType.app_bindings
enabled: bool
bindings: Tuple[AppBinding, ...]
backend: Optional[str] = None
supported: bool = False
reachable: bool = False
@dataclass(frozen=True)
class FocusAppData:
"""Message with the latest focused application, emitted during detection."""
message_type = MessageType.focused_app
app_id: str
title: str = ""