Kitty/zh-cn: Difference between revisions
Created page with "要在 shell 环境中临时使用 Kitty,可以执行:" |
Created page with "这将提供一个可用 Kitty 的 shell,而无需将其添加到系统配置中。" |
||
| Line 12: | Line 12: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
这将提供一个可用 Kitty 的 shell,而无需将其添加到系统配置中。 | |||
==== System setup ==== | ==== System setup ==== | ||
Revision as of 03:42, 9 July 2026
Kitty 是一款基于 GPU 的现代高性能终端模拟器,使用 Python 和 C 编写。它借助图形硬件实现高性能,并提供标签页、布局和基于 GPU 的渲染等特性。Kitty 在 NixOS 生态中可用,并可通过多种方式进行配置。
Installation
Shell
要在 shell 环境中临时使用 Kitty,可以执行:
nix-shell -p kitty
这将提供一个可用 Kitty 的 shell,而无需将其添加到系统配置中。
System setup
To install Kitty, add it to either the system-wide environment.systemPackages in /etc/nixos/configuration.nix or to the user-specific home.packages in ~/.config/nixpkgs/home.nix.[1]
# System-wide installation (in /etc/nixos/configuration.nix)
environment.systemPackages = with pkgs; [
kitty
];
# User-specific installation (in ~/.config/nixpkgs/home.nix)
home.packages = with pkgs; [
kitty
];
Then, rebuild your system or apply your Home Manager configuration:
# For system-wide installation
sudo nixos-rebuild switch
# For Home Manager
home-manager switch
Configuration
Basic
NixOS does not include a native module for Kitty. For basic Kitty configuration on NixOS, you need to manually follow the steps from Kitty's documentation.[2]
If you're using Home Manager, you can enable Kitty with a simple configuration:
programs.kitty.enable = true;
Advanced
For more advanced Home Manager configuration, you can specify various Kitty settings:
programs.kitty = lib.mkForce {
enable = true;
settings = {
confirm_os_window_close = 0;
dynamic_background_opacity = true;
enable_audio_bell = false;
mouse_hide_wait = "-1.0";
window_padding_width = 10;
background_opacity = "0.5";
background_blur = 5;
symbol_map = let
mappings = [
"U+23FB-U+23FE"
"U+2B58"
"U+E200-U+E2A9"
"U+E0A0-U+E0A3"
"U+E0B0-U+E0BF"
"U+E0C0-U+E0C8"
"U+E0CC-U+E0CF"
"U+E0D0-U+E0D2"
"U+E0D4"
"U+E700-U+E7C5"
"U+F000-U+F2E0"
"U+2665"
"U+26A1"
"U+F400-U+F4A8"
"U+F67C"
"U+E000-U+E00A"
"U+F300-U+F313"
"U+E5FA-U+E62B"
];
in
(builtins.concatStringsSep "," mappings) + " Symbols Nerd Font";
};
};
Tips and tricks
Theming with Stylix
stylix.targets.kitty.enable = true;