summaryrefslogtreecommitdiff
path: root/nix_archive/nix/programs/kitty.nix
blob: 86ad7206a50465cdfbc0fe600c620e6d8d417809 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{ config, lib, pkgs, ... }:
let
  loc = config.local;
  colo = loc.scheme;
in {
  environment.sessionVariables = {
    TERMINAL = "${pkgs.kitty}/bin/kitty -1";
  };
  home-manager.users.andrew = {
    programs.kitty = {
      enable = true;
      font = {
        name = loc.font.name;
        size = loc.font.size;
      };
      shellIntegration = {
        mode = "enabled";
        enableBashIntegration = true;
      };
      extraConfig = ''
        shell ${pkgs.bashInteractive}/bin/bash --login
        update_check_interval 0
        confirm_os_window_close 0
        sync_to_monitor no
        allow_remote_control yes
        linux_display_server wayland
        remember_window_size no
        initial_window_width 720
        initial_window_height 480
        resize_debounce_time 0.025 0.5
        window_padding_width 1
        placement_strategy top-left
        scrollback_lines 3000
        paste_actions confirm,confirm-if-large
        disable_ligatures always
        modify_font baseline ${toString loc.font.baseline}
        modify_font cell_height ${toString loc.font.cell-height-offset}
        cursor_shape block
        #cursor_blink_interval -1 linear ease-out
        #cursor_stop_blinking_after 20.0
        #cursor_trail 2
        #cursor_trail_decay 0.075 0.425
        #cursor_trail_start_threshold 3
        cursor #${colo.foreground}
        #cursor none
        cursor_text_color background
        foreground #${colo.foreground}
        background #${colo.background}
        color0 #${colo.color0}
        color1 #${colo.color1}
        color2 #${colo.color2}
        color3 #${colo.color3}
        color4 #${colo.color4}
        color5 #${colo.color5}
        color6 #${colo.color6}
        color7 #${colo.color7}
        color8 #${colo.color8}
        color9 #${colo.color9}
        color10 #${colo.color10}
        color11 #${colo.color11}
        color12 #${colo.color12}
        color13 #${colo.color13}
        color14 #${colo.color14}
        color15 #${colo.color15}
        selection_foreground #${colo.background}
        selection_background #${colo.color6}
        mark1_foreground #${colo.background}
        mark1_background #${colo.color5}
        mark2_foreground #${colo.background}
        mark2_background #${colo.color6}
        mark3_foreground #${colo.background}
        mark3_background #${colo.color4}
        background_opacity ${toString colo.alpha}
        active_border_color #${colo.color4}
        bell_border_color #${colo.color1}
        inactive_border_color #${colo.color3}
        active_tab_foreground #${colo.background}
        active_tab_background #${colo.color5}
        active_tab_font_style bold-italic
        inactive_tab_foreground #${colo.background}
        inactive_tab_background #${colo.color4}
        url_color #${colo.color5}
        enabled_layouts splits,stack
      '';
    };
    home.file.".config/kitty/quick-access-terminal.conf".text = ''
      lines 18
      background_opacity 0.925
      output_name ${loc.monitors.monitor1}
      kitty_override startup_session=quick-access-session.conf
      kitty_override placement_strategy=bottom-right
      kitty_override window_padding_width=0 12 8 0
    '';
    home.file.".config/kitty/quick-access-session.conf".text = ''
      layout splits
      launch --var window=main
      launch --location=vsplit --bias=17.1 /home/andrew/dl/tmp/clock/a.out
      focus_matching_window var:window=first
    '';
    wayland.windowManager.sway = {
      config = rec {
        terminal = "${pkgs.kitty}/bin/kitty -1";
        keybindings = let
          mod1 = "Mod1";
        in {
          "${mod1}+Return" = "exec ${terminal}";
          "${mod1}+backslash" = "exec ${pkgs.kitty}/bin/kitten quick-access-terminal";
        };
      };
    };
  };
}