diff --git a/home/base/gui/terminal/README.md b/home/base/gui/terminal/README.md index 2e5213ff..d38aa998 100644 --- a/home/base/gui/terminal/README.md +++ b/home/base/gui/terminal/README.md @@ -16,6 +16,8 @@ My current terminal emulators are: 2. foot: A fast, lightweight and minimalistic Wayland terminal emulator. 1. foot only do the things a terminal emulator should do, no more, no less. 1. It's really suitable for tiling window manager or zellij users! +3. alacritty: A cross-platform, GPU-accelerated terminal emulator. + 1. alacritty is really fast, I use it as a backup terminal emulator on all my desktops. ## 'xterm-kitty': unknown terminal type when `ssh` into a remote host or `sudo xxx` diff --git a/home/base/gui/terminal/alacritty/catppuccin-mocha.toml b/home/base/gui/terminal/alacritty/catppuccin-mocha.toml new file mode 100644 index 00000000..7762dcdb --- /dev/null +++ b/home/base/gui/terminal/alacritty/catppuccin-mocha.toml @@ -0,0 +1,65 @@ +[colors.primary] +background = "#1e1e2e" +foreground = "#cdd6f4" +dim_foreground = "#7f849c" +bright_foreground = "#cdd6f4" + +[colors.cursor] +text = "#1e1e2e" +cursor = "#f5e0dc" + +[colors.vi_mode_cursor] +text = "#1e1e2e" +cursor = "#b4befe" + +[colors.search.matches] +foreground = "#1e1e2e" +background = "#a6adc8" + +[colors.search.focused_match] +foreground = "#1e1e2e" +background = "#a6e3a1" + +[colors.footer_bar] +foreground = "#1e1e2e" +background = "#a6adc8" + +[colors.hints.start] +foreground = "#1e1e2e" +background = "#f9e2af" + +[colors.hints.end] +foreground = "#1e1e2e" +background = "#a6adc8" + +[colors.selection] +text = "#1e1e2e" +background = "#f5e0dc" + +[colors.normal] +black = "#45475a" +red = "#f38ba8" +green = "#a6e3a1" +yellow = "#f9e2af" +blue = "#89b4fa" +magenta = "#f5c2e7" +cyan = "#94e2d5" +white = "#bac2de" + +[colors.bright] +black = "#585b70" +red = "#f38ba8" +green = "#a6e3a1" +yellow = "#f9e2af" +blue = "#89b4fa" +magenta = "#f5c2e7" +cyan = "#94e2d5" +white = "#a6adc8" + +[[colors.indexed_colors]] +index = 16 +color = "#fab387" + +[[colors.indexed_colors]] +index = 17 +color = "#f5e0dc" diff --git a/home/base/gui/terminal/alacritty/default.nix b/home/base/gui/terminal/alacritty/default.nix new file mode 100644 index 00000000..b8108310 --- /dev/null +++ b/home/base/gui/terminal/alacritty/default.nix @@ -0,0 +1,61 @@ +{pkgs, ...}: +########################################################### +# +# Alacritty Configuration +# +# Useful Hot Keys for macOS: +# 1. Multi-Window: `command + N` +# 2. Increase Font Size: `command + =` | `command + +` +# 3. Decrease Font Size: `command + -` | `command + _` +# 4. Search Text: `command + F` +# 5. And Other common shortcuts such as Copy, Paste, Cursor Move, etc. +# +# Useful Hot Keys for Linux: +# 1. Increase Font Size: `ctrl + shift + =` | `ctrl + shift + +` +# 2. Decrease Font Size: `ctrl + shift + -` | `ctrl + shift + _` +# 3. Search Text: `ctrl + shift + N` +# 4. And Other common shortcuts such as Copy, Paste, Cursor Move, etc. +# +# Note: Alacritty do not have support for Tabs, and any graphic protocol. +# +########################################################### +{ + programs.alacritty = { + enable = true; + # https://alacritty.org/config-alacritty.html + settings = { + general.import = [ + ./catppuccin-mocha.toml + ]; + window = { + opacity = 0.93; + startup_mode = "Maximized"; # Maximized window + dynamic_title = true; + option_as_alt = "Both"; # Option key acts as Alt on macOS + }; + scrolling = { + history = 10000; + }; + font = { + bold = {family = "JetBrainsMono Nerd Font";}; + italic = {family = "JetBrainsMono Nerd Font";}; + normal = {family = "JetBrainsMono Nerd Font";}; + bold_italic = {family = "JetBrainsMono Nerd Font";}; + size = + if pkgs.stdenv.isDarwin + then 14 + else 13; + }; + terminal = { + # Spawn a nushell in login mode via `bash` + shell = { + program = "${pkgs.bash}/bin/bash"; + args = ["--login" "-c" "nu --login --interactive"]; + }; + # Controls the ability to write to the system clipboard with the OSC 52 escape sequence. + # It's used by zellij to copy text to the system clipboard. + osc52 = "CopyPaste"; + }; + }; + }; +} diff --git a/home/base/gui/terminal/foot.nix b/home/base/gui/terminal/foot.nix index edc9d471..d6884927 100644 --- a/home/base/gui/terminal/foot.nix +++ b/home/base/gui/terminal/foot.nix @@ -9,7 +9,7 @@ font = "JetBrainsMono Nerd Font:size=13"; dpi-aware = "yes"; - # Spawn a nushell in login mode via `bash` + # Spawn a nushell in login mode via `bash` shell = "${pkgs.bash}/bin/bash --login -c 'nu --login --interactive'"; }; diff --git a/home/base/gui/terminal/kitty.nix b/home/base/gui/terminal/kitty.nix index fe7168ef..c58f72f7 100644 --- a/home/base/gui/terminal/kitty.nix +++ b/home/base/gui/terminal/kitty.nix @@ -29,7 +29,7 @@ else 13; }; - # consistent with wezterm + # consistent with other terminal emulators keybindings = { "ctrl+shift+m" = "toggle_maximized"; "ctrl+shift+f" = "show_scrollback"; # search in the current window diff --git a/home/darwin/aerospace/aerospace.toml b/home/darwin/aerospace/aerospace.toml index 815fc30f..0feba79d 100644 --- a/home/darwin/aerospace/aerospace.toml +++ b/home/darwin/aerospace/aerospace.toml @@ -200,8 +200,8 @@ if.app-id = 'net.kovidgoyal.kitty' run = 'move-node-to-workspace 1Kitty' [[on-window-detected]] -if.app-id = 'com.github.wez.wezterm' -run = 'move-node-to-workspace 2Wez' +if.app-id = 'org.alacritty' +run = 'move-node-to-workspace 2Alacritty' [[on-window-detected]] if.app-id = 'com.tencent.WeWorkMac' @@ -246,7 +246,7 @@ run = 'layout floating' [workspace-to-monitor-force-assignment] 1Kitty = 'secondary' # Non-main monitor in case when there are only two monitors' -2Wez = 'main' # "Main" monitor ("main" as in System Settings → Displays → Use as) +2Alacritty = 'main' # "Main" monitor ("main" as in System Settings → Displays → Use as) 3Work = 'main' 4Firefox = 'main' 5Chrome = 'secondary' diff --git a/modules/darwin/apps.nix b/modules/darwin/apps.nix index 1db23cba..2fd4fd63 100644 --- a/modules/darwin/apps.nix +++ b/modules/darwin/apps.nix @@ -155,8 +155,6 @@ in { "visual-studio-code" "zed" # zed editor "aerospace" # an i3-like tiling window manager for macOS - # "wezterm" - # "tor-browser" # https://joplinapp.org/help/ # "joplin" # note taking app diff --git a/modules/darwin/users.nix b/modules/darwin/users.nix index a8ccf9b5..f2de326e 100644 --- a/modules/darwin/users.nix +++ b/modules/darwin/users.nix @@ -6,6 +6,6 @@ # set user's default shell back to zsh # `chsh -s /bin/zsh` # DO NOT change the system's default shell to nushell! it will break some apps! - # It's better to change only kitty/wezterm's shell to nushell! + # It's better to change only kitty/wezterm & other terminal emulator's shell to nushell! }; } diff --git a/modules/nixos/desktop/misc.nix b/modules/nixos/desktop/misc.nix index 5838684d..cc9cbffa 100644 --- a/modules/nixos/desktop/misc.nix +++ b/modules/nixos/desktop/misc.nix @@ -13,7 +13,7 @@ # set user's default shell system-wide users.defaultUserShell = pkgs.bashInteractive; - # fix for `sudo xxx` in kitty/wezterm and other modern terminal emulators + # fix for `sudo xxx` in kitty/wezterm/foot and other modern terminal emulators security.sudo.keepTerminfo = true; environment.variables = {