replace wezterm with ghostty on linux

This commit is contained in:
Noah Masur
2025-05-03 20:34:46 -04:00
parent faac8f3c8b
commit 61c4e68fef
6 changed files with 39 additions and 20 deletions

View File

@ -199,19 +199,25 @@ in
exec = "${lib.getExe config.nmasur.presets.services.i3.terminal} aerc %u";
};
xsession.windowManager.i3.config.keybindings = lib.mkIf pkgs.stdenv.isLinux {
"${config.xsession.windowManager.i3.config.modifier}+Shift+e" = "exec ${
# Don't name the script `aerc` or it will affect grep
builtins.toString (
pkgs.writeShellScript "focus-mail.sh" ''
count=$(ps aux | grep -c aerc)
if [ "$count" -eq 1 ]; then
i3-msg "exec --no-startup-id ${lib.getExe config.nmasur.presets.services.i3.terminal} start --class aerc -- aerc"
sleep 0.25
fi
i3-msg "[class=aerc] focus"
''
)
}";
"${config.xsession.windowManager.i3.config.modifier}+Shift+e" =
let
terminal = config.nmasur.presets.services.i3.terminal;
startupCommand =
if terminal == pkgs.wezterm then "start --class aerc -- aerc" else "--class=aerc --command=aerc";
in
"exec ${
# Don't name the script `aerc` or it will affect grep
builtins.toString (
pkgs.writeShellScript "focus-mail.sh" ''
count=$(ps aux | grep -c aerc)
if [ "$count" -eq 1 ]; then
i3-msg "exec --no-startup-id ${lib.getExe terminal} ${startupCommand}"
sleep 0.25
fi
i3-msg "[class=aerc] focus"
''
)
}";
};
programs.fish.shellAbbrs = {

View File

@ -14,6 +14,10 @@ in
options.nmasur.presets.programs.ghostty.enable = lib.mkEnableOption "Ghostty terminal";
config = lib.mkIf cfg.enable {
# Set the i3 terminal
nmasur.presets.services.i3.terminal = config.programs.ghostty.package;
programs.ghostty = {
enable = true;
@ -29,7 +33,7 @@ in
macos-titlebar-style = "hidden";
window-decoration = false;
macos-non-native-fullscreen = true;
fullscreen = true;
fullscreen = if pkgs.stdenv.isDarwin then true else false;
keybind = [
"super+t=unbind" # Pass super-t to underlying tool (e.g. zellij tabs)
"super+shift+]=unbind"