From b0df8ef27fe44cac5fdae1bd58195bfd4feb2f59 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Sun, 14 Jun 2026 03:32:47 -0700 Subject: [PATCH] Add backup AI scratchpad binding --- docs/tiling-wm-experience.md | 3 ++- dotfiles/config/hypr/hyprland/binds.lua | 1 + dotfiles/config/hypr/hyprland/scratchpads.lua | 13 +++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/docs/tiling-wm-experience.md b/docs/tiling-wm-experience.md index af5f5559..ee657698 100644 --- a/docs/tiling-wm-experience.md +++ b/docs/tiling-wm-experience.md @@ -439,7 +439,8 @@ Required behavior: Required behavior: -- `Super+Alt+c` toggles the codex scratchpad. +- `Super+Alt+c` toggles the primary AI scratchpad. +- `Super+Alt+Shift+c` toggles the backup AI scratchpad. - `Super+Alt+e` toggles the element scratchpad. - `Super+Alt+h` toggles the htop scratchpad. - `Super+Alt+k` toggles the slack scratchpad. diff --git a/dotfiles/config/hypr/hyprland/binds.lua b/dotfiles/config/hypr/hyprland/binds.lua index 8550b2bf..1ec2fbf3 100644 --- a/dotfiles/config/hypr/hyprland/binds.lua +++ b/dotfiles/config/hypr/hyprland/binds.lua @@ -265,6 +265,7 @@ function M.setup(ctx) local function setup_scratchpad_bindings() bind(main_mod .. " + SHIFT + X", hl.dsp.workspace.toggle_special("NSP"), desc("Toggle NSP special workspace")) bind(mod_alt .. " + C", toggle_active_ai_scratchpad, desc("Toggle AI scratchpad (Codex/Claude)")) + bind(mod_alt .. " + SHIFT + C", toggle_backup_ai_scratchpad, desc("Toggle backup AI scratchpad (Codex/Claude)")) bind(mod_alt .. " + D", function() toggle_scratchpad("discord") end, desc("Toggle Discord scratchpad")) diff --git a/dotfiles/config/hypr/hyprland/scratchpads.lua b/dotfiles/config/hypr/hyprland/scratchpads.lua index a13c99f0..d2f0b4e3 100644 --- a/dotfiles/config/hypr/hyprland/scratchpads.lua +++ b/dotfiles/config/hypr/hyprland/scratchpads.lua @@ -550,6 +550,17 @@ function M.setup(ctx) toggle_scratchpad(active_ai_scratchpad()) end + local function backup_ai_scratchpad() + if active_ai_scratchpad() == "codex" then + return "claude" + end + return "codex" + end + + local function toggle_backup_ai_scratchpad() + toggle_scratchpad(backup_ai_scratchpad()) + end + -- Used by rofi_ai_scratchpad.sh after a selection: bring the chosen -- scratchpad into view if it isn't already, without hiding it when it is. local function show_active_ai_scratchpad() @@ -601,7 +612,9 @@ function M.setup(ctx) ctx.adopt_matching_scratchpad_window = adopt_matching_scratchpad_window ctx.toggle_scratchpad = toggle_scratchpad ctx.active_ai_scratchpad = active_ai_scratchpad + ctx.backup_ai_scratchpad = backup_ai_scratchpad ctx.toggle_active_ai_scratchpad = toggle_active_ai_scratchpad + ctx.toggle_backup_ai_scratchpad = toggle_backup_ai_scratchpad ctx.show_active_ai_scratchpad = show_active_ai_scratchpad end