Add backup AI scratchpad binding

This commit is contained in:
2026-06-14 03:32:47 -07:00
parent 4681f49d81
commit b0df8ef27f
3 changed files with 16 additions and 1 deletions

View File

@@ -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.

View File

@@ -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"))

View File

@@ -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