Fix for drop down terms
This commit is contained in:
parent
3ecb26a760
commit
a1dd786801
1 changed files with 11 additions and 6 deletions
|
|
@ -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
|
||||
;; 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))
|
||||
(current (current-group))
|
||||
(target (find-group screen group-name))
|
||||
(existing (when window-title
|
||||
(existing (or (when window-class
|
||||
(find-if (lambda (w) (string= (window-class w) window-class))
|
||||
(screen-windows screen)))
|
||||
(when window-title
|
||||
(find-if (lambda (w) (string= (window-name w) window-title))
|
||||
(screen-windows screen)))))
|
||||
(screen-windows screen))))))
|
||||
(if (eq current target)
|
||||
(when *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 () ()
|
||||
"Toggle fullscreen persistent terminal (wezterm)."
|
||||
(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 () ()
|
||||
"Toggle second fullscreen persistent terminal (wezterm)."
|
||||
(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 () ()
|
||||
"Toggle fullscreen persistent emacsclient frame."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue