feat: add alacritty

This commit is contained in:
Ryan Yin
2024-11-12 22:10:20 +08:00
parent ab3c88b071
commit 39fc4a118f
9 changed files with 135 additions and 9 deletions

View File

@@ -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`

View File

@@ -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"

View File

@@ -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";
};
};
};
}

View File

@@ -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'";
};

View File

@@ -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

View File

@@ -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'

View File

@@ -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

View File

@@ -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!
};
}

View File

@@ -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 = {