nix-home/home/modules/programs/my-kitty/darwin.nix
Natsu Kagami 21c8317fd2
Implement a kitty module
Squashed commit of the following:

commit eb319d25ee2bc60dc4c58f3ee3e70ea2035a2b96
Author: Natsu Kagami <nki@nkagami.me>
Date:   Fri Jun 10 13:41:33 2022 -0400

    Map yen sign to backslash

commit 6d29a296ed789ac20bfcd6e74a48536d0e658582
Author: Natsu Kagami <nki@nkagami.me>
Date:   Fri Jun 10 13:23:30 2022 -0400

    Add kitty options

commit 47b366cbd0fd17c06c4e415b291e2329f8831939
Author: Natsu Kagami <nki@nkagami.me>
Date:   Fri Jun 10 11:42:51 2022 -0400

    Some basic set up to make kitty happy
2022-06-10 13:41:53 -04:00

64 lines
1.9 KiB
Nix

{ pkgs, config, lib, ... }:
let
cfg = config.nki.programs.kitty;
cmd = "cmd";
in
with lib; {
programs.kitty = mkIf (cfg.enable && pkgs.stdenv.isDarwin) {
# Darwin-specific setup
darwinLaunchOptions = [
"--single-instance"
"--start-as=fullscreen"
];
# Tabs and layouts keybindings
keybindings = {
# Backslash
"0x5d" = "send_text all \\u005c";
"${cmd}+shift+o" = "launch --location=vsplit";
"${cmd}+o" = "launch --location=hsplit";
"${cmd}+shift+r" = "layout_action rotate";
## Move the active window in the indicated direction
"${cmd}+shift+h" = "move_window left";
"${cmd}+shift+j" = "move_window up";
"${cmd}+shift+k" = "move_window down";
"${cmd}+shift+l" = "move_window right";
## Switch focus to the neighboring window in the indicated direction
"${cmd}+h" = "neighboring_window left";
"${cmd}+j" = "neighboring_window up";
"${cmd}+k" = "neighboring_window down ";
"${cmd}+l" = "neighboring_window right";
}
# Tab bindings
// builtins.listToAttrs
(map
(x: attrsets.nameValuePair "${cmd}+${toString x}" "goto_tab ${toString x}")
(lists.range 1 9));
extraConfig = mkAfter ''
# Tab settings
tab_bar_edge top
tab_bar_style powerline
tab_powerline_style slanted
tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.lightgreen}{fmt.bold}[{index}]{fmt.nobold} {fmt.fg.tab}{title}"
active_tab_title_template "{fmt.fg.red}{bell_symbol}{activity_symbol}{fmt.fg.tab}{title}"
tab_bar_background #555
active_tab_font_style normal
# Layouts
## Mouse focus
focus_follows_mouse yes
## Layout options
# Layouts
enabled_layouts Splits
inactive_text_alpha 0.65
# MacOS specific
macos_option_as_alt = left
'';
};
}