2024-04-20 13:42:06 +00:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
{
|
2022-10-31 00:13:32 +00:00
|
|
|
|
2022-12-21 21:18:03 +00:00
|
|
|
options = {
|
|
|
|
kitty = {
|
|
|
|
enable = lib.mkEnableOption {
|
|
|
|
description = "Enable Kitty.";
|
|
|
|
default = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf (config.gui.enable && config.kitty.enable) {
|
2023-03-19 16:49:41 +00:00
|
|
|
|
|
|
|
# Set the Rofi-Systemd terminal for viewing logs
|
2023-03-22 20:20:30 +00:00
|
|
|
# Using optionalAttrs because only available in NixOS
|
2024-04-20 13:42:06 +00:00
|
|
|
environment =
|
|
|
|
{ }
|
|
|
|
// lib.attrsets.optionalAttrs (builtins.hasAttr "sessionVariables" config.environment) {
|
2024-06-23 12:54:30 +00:00
|
|
|
sessionVariables.ROFI_SYSTEMD_TERM = lib.mkDefault "${pkgs.kitty}/bin/kitty";
|
2023-03-22 20:20:30 +00:00
|
|
|
};
|
2023-03-19 16:49:41 +00:00
|
|
|
|
2022-10-31 00:13:32 +00:00
|
|
|
home-manager.users.${config.user} = {
|
2023-03-19 16:49:41 +00:00
|
|
|
|
|
|
|
# Set the i3 terminal
|
2024-04-20 13:42:06 +00:00
|
|
|
xsession.windowManager.i3.config.terminal = lib.mkIf pkgs.stdenv.isLinux "kitty";
|
2023-03-19 16:49:41 +00:00
|
|
|
|
|
|
|
# Set the Rofi terminal for running programs
|
2024-06-23 12:54:30 +00:00
|
|
|
programs.rofi.terminal = lib.mkIf pkgs.stdenv.isLinux (lib.mkDefault "${pkgs.kitty}/bin/kitty");
|
2023-03-19 16:49:41 +00:00
|
|
|
|
2023-07-19 03:36:09 +00:00
|
|
|
# Display images in the terminal
|
2024-06-29 12:01:23 +00:00
|
|
|
programs.fish.interactiveShellInit = # fish
|
|
|
|
''
|
|
|
|
if test "$TERM" = "xterm-kitty"
|
|
|
|
alias icat="kitty +kitten icat"
|
|
|
|
alias ssh="kitty +kitten ssh"
|
|
|
|
end
|
|
|
|
'';
|
2023-07-19 03:36:09 +00:00
|
|
|
|
2022-10-31 00:13:32 +00:00
|
|
|
programs.kitty = {
|
|
|
|
enable = true;
|
|
|
|
environment = { };
|
|
|
|
extraConfig = "";
|
|
|
|
font.size = 14;
|
2022-11-01 00:47:33 +00:00
|
|
|
keybindings = {
|
2023-07-30 03:56:41 +00:00
|
|
|
# Use shift+enter to complete text suggestions in fish
|
2022-11-01 00:47:33 +00:00
|
|
|
"shift+enter" = "send_text all \\x1F";
|
2023-07-30 03:56:41 +00:00
|
|
|
|
|
|
|
# Easy fullscreen toggle (for macOS)
|
2022-11-01 00:47:33 +00:00
|
|
|
"super+f" = "toggle_fullscreen";
|
|
|
|
};
|
2022-10-31 00:13:32 +00:00
|
|
|
settings = {
|
|
|
|
|
|
|
|
# Colors (adapted from: https://github.com/kdrag0n/base16-kitty/blob/master/templates/default-256.mustache)
|
2022-11-03 01:29:14 +00:00
|
|
|
background = config.theme.colors.base00;
|
|
|
|
foreground = config.theme.colors.base05;
|
|
|
|
selection_background = config.theme.colors.base05;
|
|
|
|
selection_foreground = config.theme.colors.base00;
|
|
|
|
url_color = config.theme.colors.base04;
|
|
|
|
cursor = config.theme.colors.base05;
|
|
|
|
active_border_color = config.theme.colors.base03;
|
|
|
|
inactive_border_color = config.theme.colors.base01;
|
|
|
|
active_tab_background = config.theme.colors.base00;
|
|
|
|
active_tab_foreground = config.theme.colors.base05;
|
|
|
|
inactive_tab_background = config.theme.colors.base01;
|
|
|
|
inactive_tab_foreground = config.theme.colors.base04;
|
|
|
|
tab_bar_background = config.theme.colors.base01;
|
2022-10-31 00:13:32 +00:00
|
|
|
|
|
|
|
# normal
|
2022-11-03 01:29:14 +00:00
|
|
|
color0 = config.theme.colors.base00;
|
|
|
|
color1 = config.theme.colors.base08;
|
|
|
|
color2 = config.theme.colors.base0B;
|
|
|
|
color3 = config.theme.colors.base0A;
|
|
|
|
color4 = config.theme.colors.base0D;
|
|
|
|
color5 = config.theme.colors.base0E;
|
|
|
|
color6 = config.theme.colors.base0C;
|
|
|
|
color7 = config.theme.colors.base05;
|
2022-10-31 00:13:32 +00:00
|
|
|
|
|
|
|
# bright
|
2022-11-03 01:29:14 +00:00
|
|
|
color8 = config.theme.colors.base03;
|
|
|
|
color9 = config.theme.colors.base08;
|
|
|
|
color10 = config.theme.colors.base0B;
|
|
|
|
color11 = config.theme.colors.base0A;
|
|
|
|
color12 = config.theme.colors.base0D;
|
|
|
|
color13 = config.theme.colors.base0E;
|
|
|
|
color14 = config.theme.colors.base0C;
|
|
|
|
color15 = config.theme.colors.base07;
|
2022-10-31 00:13:32 +00:00
|
|
|
|
|
|
|
# extended base16 colors
|
2022-11-03 01:29:14 +00:00
|
|
|
color16 = config.theme.colors.base09;
|
|
|
|
color17 = config.theme.colors.base0F;
|
|
|
|
color18 = config.theme.colors.base01;
|
|
|
|
color19 = config.theme.colors.base02;
|
|
|
|
color20 = config.theme.colors.base04;
|
|
|
|
color21 = config.theme.colors.base06;
|
2022-10-31 00:13:32 +00:00
|
|
|
|
|
|
|
# Scrollback
|
2024-02-28 21:10:56 +00:00
|
|
|
scrollback_lines = 10000;
|
|
|
|
scrollback_pager_history_size = 300; # MB
|
2022-10-31 00:13:32 +00:00
|
|
|
|
|
|
|
# Window
|
2022-10-31 18:45:51 +00:00
|
|
|
window_padding_width = 6;
|
2022-10-31 00:13:32 +00:00
|
|
|
|
2022-10-31 00:43:34 +00:00
|
|
|
tab_bar_edge = "top";
|
|
|
|
tab_bar_style = "slant";
|
2022-11-04 01:20:29 +00:00
|
|
|
|
2023-07-30 03:56:41 +00:00
|
|
|
# Disable audio
|
2022-11-04 01:20:29 +00:00
|
|
|
enable_audio_bell = false;
|
2022-10-31 00:13:32 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|