diff --git a/core/internal/config/embedded/hypr-binds.conf b/core/internal/config/embedded/hypr-binds.conf index dfe56309..f7b74fb4 100644 --- a/core/internal/config/embedded/hypr-binds.conf +++ b/core/internal/config/embedded/hypr-binds.conf @@ -158,5 +158,8 @@ bind = , Print, exec, dms screenshot bind = CTRL, Print, exec, dms screenshot full bind = ALT, Print, exec, dms screenshot window +# === Display Profiles === +bind = SUPER, P, exec, dms ipc outputs cycleProfile + # === System Controls === bind = SUPER SHIFT, P, dpms, toggle diff --git a/core/internal/config/embedded/niri-binds.kdl b/core/internal/config/embedded/niri-binds.kdl index 27cb860e..5b6d5286 100644 --- a/core/internal/config/embedded/niri-binds.kdl +++ b/core/internal/config/embedded/niri-binds.kdl @@ -215,6 +215,11 @@ binds { Print { screenshot; } Ctrl+Print { screenshot-screen; } Alt+Print { screenshot-window; } + // === Display Profiles === + Mod+P hotkey-overlay-title="Cycle Display Profile" { + spawn "dms" "ipc" "outputs" "cycleProfile"; + } + // === System Controls === Mod+Escape allow-inhibiting=false { toggle-keyboard-shortcuts-inhibit; } Mod+Shift+P { power-off-monitors; } diff --git a/quickshell/DMSShellIPC.qml b/quickshell/DMSShellIPC.qml index b45fa7d6..ac8a259a 100644 --- a/quickshell/DMSShellIPC.qml +++ b/quickshell/DMSShellIPC.qml @@ -1726,6 +1726,22 @@ Item { return `PROFILE_SET_SUCCESS: ${profileName}`; } + function cycleProfile(): string { + if (SettingsData.displayProfileAutoSelect) + return "ERROR: Auto profile selection is enabled. Use toggleAuto first"; + + const profiles = DisplayConfigState.validatedProfiles; + const ids = Object.keys(profiles).filter(id => profiles[id].name); + if (ids.length === 0) + return "ERROR: No profiles configured"; + + const activeId = SettingsData.getActiveDisplayProfile(CompositorService.compositor); + const idx = ids.indexOf(activeId); + const nextId = ids[(idx + 1) % ids.length]; + DisplayConfigState.activateProfile(nextId); + return `PROFILE_SET_SUCCESS: ${profiles[nextId].name}`; + } + function toggleAuto(): string { SettingsData.displayProfileAutoSelect = !SettingsData.displayProfileAutoSelect; SettingsData.saveSettings();