Skip to content

Commit 8b8918e

Browse files
committed
Have toggling the quick access terminal via the kitten also move it to the active monitor
1 parent edda367 commit 8b8918e

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

kittens/panel/main.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], envi
171171
for os_window_id in boss.os_window_map:
172172
existing = layer_shell_config_for_os_window(os_window_id)
173173
layer_shell_config_changed = not existing or any(f for f in lsc._fields if getattr(lsc, f) != existing.get(f))
174-
toggle_os_window_visibility(os_window_id)
174+
toggle_os_window_visibility(os_window_id, move_to_active_screen=args.move_to_active_monitor)
175175
if layer_shell_config_changed:
176176
set_layer_shell_config(os_window_id, lsc)
177177
return
@@ -184,7 +184,7 @@ def handle_single_instance_command(boss: BossType, sys_args: Sequence[str], envi
184184

185185

186186
def main(sys_args: list[str]) -> None:
187-
# run_kitten run using runpy.run_module which does not import into
187+
# run_kitten runs using runpy.run_module which does not import into
188188
# sys.modules, which means the module will be re-imported later, causing
189189
# global variables to be duplicated, so do it now.
190190
from kittens.panel.main import actual_main

kittens/quick_access_terminal/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func main(cmd *cli.Command, opts *Options, args []string) (rc int, err error) {
3737
if err != nil {
3838
return 1, err
3939
}
40-
argv := []string{kitty_exe, "+kitten", "panel", "--toggle-visibility", "--exclusive-zone=0", "--override-exclusive-zone", "--layer=overlay", "--single-instance"}
40+
argv := []string{kitty_exe, "+kitten", "panel", "--toggle-visibility", "--exclusive-zone=0", "--override-exclusive-zone", "--layer=overlay", "--single-instance", "--move-to-active-monitor"}
4141
argv = append(argv, fmt.Sprintf("--lines=%s", conf.Lines))
4242
argv = append(argv, fmt.Sprintf("--columns=%s", conf.Columns))
4343
argv = append(argv, fmt.Sprintf("--edge=%s", conf.Edge))

kitty/simple_cli_definitions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -747,6 +747,14 @@ def build_panel_cli_spec(defaults: dict[str, str]) -> str:
747747
existing panel rather than creating a new one.
748748
749749
750+
--move-to-active-monitor
751+
type=bool-set
752+
default=false
753+
When set and using :option:`--toggle-visibility` to show an existing panel, the panel
754+
is moved to the active monitor (typically the monitor with the mouse on it).
755+
This works only if the underlying OS supports it. It is currently supported on macOS only.
756+
757+
750758
--start-as-hidden
751759
type=bool-set
752760
default={start_as_hidden}

0 commit comments

Comments
 (0)