Fix for drop down terms

This commit is contained in:
Ian Keane 2026-08-09 15:04:15 -04:00
parent 3ecb26a760
commit a1dd786801

View file

@ -340,13 +340,16 @@ If PERSISTENT is t, smart-kill will hide the window instead of killing it."
;; returns to wherever you came from. We track the previous group ourselves ;; returns to wherever you came from. We track the previous group ourselves
;; rather than relying on gother, which is unreliable when windows spawn async. ;; rather than relying on gother, which is unreliable when windows spawn async.
(defun toggle-scratchpad-group (group-name command &key window-title) (defun toggle-scratchpad-group (group-name command &key window-class window-title)
(let* ((screen (current-screen)) (let* ((screen (current-screen))
(current (current-group)) (current (current-group))
(target (find-group screen group-name)) (target (find-group screen group-name))
(existing (when window-title (existing (or (when window-class
(find-if (lambda (w) (string= (window-name w) window-title)) (find-if (lambda (w) (string= (window-class w) window-class))
(screen-windows screen))))) (screen-windows screen)))
(when window-title
(find-if (lambda (w) (string= (window-name w) window-title))
(screen-windows screen))))))
(if (eq current target) (if (eq current target)
(when *scratchpad-previous-group* (when *scratchpad-previous-group*
(switch-to-group *scratchpad-previous-group*)) (switch-to-group *scratchpad-previous-group*))
@ -366,12 +369,14 @@ If PERSISTENT is t, smart-kill will hide the window instead of killing it."
(defcommand scratch-term-1 () () (defcommand scratch-term-1 () ()
"Toggle fullscreen persistent terminal (wezterm)." "Toggle fullscreen persistent terminal (wezterm)."
(toggle-scratchpad-group "scratch-term-1" (toggle-scratchpad-group "scratch-term-1"
"wezterm start --class scratch-term-1")) "wezterm start --class scratch-term-1"
:window-class "scratch-term-1"))
(defcommand scratch-term-2 () () (defcommand scratch-term-2 () ()
"Toggle second fullscreen persistent terminal (wezterm)." "Toggle second fullscreen persistent terminal (wezterm)."
(toggle-scratchpad-group "scratch-term-2" (toggle-scratchpad-group "scratch-term-2"
"wezterm start --class scratch-term-2")) "wezterm start --class scratch-term-2"
:window-class "scratch-term-2"))
(defcommand scratch-emacs-1 () () (defcommand scratch-emacs-1 () ()
"Toggle fullscreen persistent emacsclient frame." "Toggle fullscreen persistent emacsclient frame."