mirror of
https://github.com/moons-14/dotfiles.git
synced 2026-10-06 04:08:12 +09:00
fix(labwc): close only the active Ghostty tab with Mod+Q
This commit is contained in:
@@ -20,6 +20,20 @@ let
|
|||||||
"@command" = command;
|
"@command" = command;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
closeFocused = {
|
||||||
|
"@key" = "W-q";
|
||||||
|
"@onRelease" = "yes";
|
||||||
|
action = {
|
||||||
|
"@name" = "If";
|
||||||
|
query.identifier = "com.mitchellh.ghostty";
|
||||||
|
"then".action = {
|
||||||
|
"@name" = "Execute";
|
||||||
|
"@command" = "${lib.getExe' pkgs.wtype "wtype"} -M ctrl -M shift -P w -p w -m shift -m ctrl";
|
||||||
|
};
|
||||||
|
"else".action."@name" = "Close";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
snapToEdge =
|
snapToEdge =
|
||||||
key: direction:
|
key: direction:
|
||||||
keybind key {
|
keybind key {
|
||||||
@@ -99,7 +113,7 @@ in
|
|||||||
numlock = "on";
|
numlock = "on";
|
||||||
keybind = [
|
keybind = [
|
||||||
# labwc window management
|
# labwc window management
|
||||||
(action "W-q" "Close")
|
closeFocused
|
||||||
(action "W-f" "ToggleMaximize")
|
(action "W-f" "ToggleMaximize")
|
||||||
(action "W-c" "Iconify")
|
(action "W-c" "Iconify")
|
||||||
(execute "W-Tab" "window-overview")
|
(execute "W-Tab" "window-overview")
|
||||||
@@ -222,6 +236,10 @@ in
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Labwc's Close action closes Ghostty's whole GTK window. Route Mod+Q to
|
||||||
|
# Ghostty's current-tab action instead while keeping normal window close elsewhere.
|
||||||
|
programs.ghostty.settings.keybind = [ "ctrl+shift+w=close_tab" ];
|
||||||
|
|
||||||
xdg.configFile."labwc/shutdown".text = lib.mkAfter ''
|
xdg.configFile."labwc/shutdown".text = lib.mkAfter ''
|
||||||
${systemctl} --user stop graphical-session.target
|
${systemctl} --user stop graphical-session.target
|
||||||
'';
|
'';
|
||||||
|
|||||||
Reference in New Issue
Block a user