mirror of
https://github.com/nmasur/dotfiles
synced 2025-05-10 01:55:52 +00:00
replace wezterm with ghostty on linux
This commit is contained in:
parent
faac8f3c8b
commit
61c4e68fef
@ -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 = {
|
||||
|
@ -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"
|
||||
|
@ -94,7 +94,7 @@ in
|
||||
ws10 = "10:X";
|
||||
in
|
||||
{
|
||||
terminal = cfg.terminal.meta.mainProgram;
|
||||
# terminal = cfg.terminal.meta.mainProgram;
|
||||
modifier = modifier;
|
||||
assigns = {
|
||||
"${ws1}" = [ { class = "Firefox"; } ];
|
||||
@ -103,6 +103,7 @@ in
|
||||
{ class = "kitty"; }
|
||||
{ class = "obsidian"; }
|
||||
{ class = "wezterm"; }
|
||||
{ class = "ghostty"; }
|
||||
];
|
||||
"${ws3}" = [ { class = "discord"; } ];
|
||||
"${ws4}" = [
|
||||
@ -213,9 +214,9 @@ in
|
||||
cfg.commands.lockScreen != null
|
||||
) "exec ${cfg.commands.lockScreen}";
|
||||
"${modifier}+Mod1+h" =
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal} --command sh -c '${pkgs.home-manager}/bin/home-manager switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
||||
"${modifier}+Mod1+r" =
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal} -e sh -c 'doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
||||
"exec --no-startup-id ${lib.getExe cfg.terminal} --command sh -c 'doas nixos-rebuild switch --flake ${config.nmasur.presets.programs.dotfiles.path} || read'";
|
||||
|
||||
# Window options
|
||||
"${modifier}+q" = "kill";
|
||||
|
@ -136,7 +136,15 @@ in
|
||||
fi
|
||||
''
|
||||
);
|
||||
click-left = "i3-msg 'exec --no-startup-id kitty --class aerc aerc'; sleep 0.15; i3-msg '[class=aerc] focus'";
|
||||
click-left =
|
||||
let
|
||||
startupCommand =
|
||||
if config.nmasur.presets.services.i3.terminal == pkgs.wezterm then
|
||||
"start --class aerc -- aerc"
|
||||
else
|
||||
"--class=aerc --command=aerc";
|
||||
in
|
||||
"i3-msg 'exec --no-startup-id ${config.nmasur.presets.services.i3.terminal} ${startupCommand}'; sleep 0.15; i3-msg '[class=aerc] focus'";
|
||||
};
|
||||
"module/network" = {
|
||||
type = "internal/network";
|
||||
|
@ -24,13 +24,13 @@ in
|
||||
discord.enable = lib.mkDefault true;
|
||||
dotfiles.enable = lib.mkDefault true;
|
||||
firefox.enable = lib.mkDefault true;
|
||||
ghostty.enable = lib.mkDefault true;
|
||||
mpv.enable = lib.mkDefault true;
|
||||
nautilus.enable = lib.mkDefault true;
|
||||
notmuch.enable = lib.mkDefault true;
|
||||
nsxiv.enable = lib.mkDefault true;
|
||||
obsidian.enable = lib.mkDefault true;
|
||||
rofi.enable = lib.mkDefault true;
|
||||
wezterm.enable = lib.mkDefault true;
|
||||
xclip.enable = lib.mkDefault true;
|
||||
zathura.enable = lib.mkDefault true;
|
||||
};
|
||||
|
@ -55,6 +55,7 @@ in
|
||||
firefox.enable = lib.mkDefault true;
|
||||
fish.enable = lib.mkDefault true;
|
||||
fzf.enable = lib.mkDefault true;
|
||||
ghostty.enable = lib.mkDefault true;
|
||||
git-work.enable = lib.mkDefault true;
|
||||
git.enable = lib.mkDefault true;
|
||||
github.enable = lib.mkDefault true;
|
||||
@ -67,7 +68,6 @@ in
|
||||
starship.enable = lib.mkDefault true;
|
||||
terraform.enable = lib.mkDefault true;
|
||||
weather.enable = lib.mkDefault true;
|
||||
wezterm.enable = lib.mkDefault true;
|
||||
};
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user