From 1c443763428d7b9bd6e0e11834f2d5f3299b103c Mon Sep 17 00:00:00 2001 From: winston Date: Sat, 8 Jun 2024 18:11:28 +0200 Subject: [PATCH] feat(kitty): reinit & fix miscellaneous issues --- _sources/generated.json | 8 +-- _sources/generated.nix | 8 +-- home/apps/colorscheme-sync.nix | 4 +- home/apps/default.nix | 2 +- home/apps/foot.nix | 57 -------------------- home/apps/gtk.nix | 5 +- home/apps/hyprland.nix | 2 +- home/apps/kitty.nix | 97 ++++++++++++++++++++++++++++++++++ home/apps/nu.nix | 5 +- home/apps/nu/config.nu | 8 +-- home/apps/vscode.nix | 10 +--- home/apps/wezterm.nix | 5 +- home/default.nix | 5 +- 13 files changed, 120 insertions(+), 96 deletions(-) delete mode 100644 home/apps/foot.nix create mode 100644 home/apps/kitty.nix diff --git a/_sources/generated.json b/_sources/generated.json index f19edee..0744557 100644 --- a/_sources/generated.json +++ b/_sources/generated.json @@ -21,7 +21,7 @@ }, "milspec": { "cargoLocks": null, - "date": "2024-05-30", + "date": "2024-06-08", "extract": null, "name": "milspec", "passthru": null, @@ -33,11 +33,11 @@ "name": null, "owner": "nekowinston", "repo": "milspec.nvim", - "rev": "89b7d29dad6708c04821cbf8ba8c80294f8d1733", - "sha256": "sha256-GWto6Y+2ZJXgTbOApQrhzsBT9sPENhgqoD6SSxykAVE=", + "rev": "3988464c4514e441b4f81599507bdf2815b2f9e2", + "sha256": "sha256-2U8yqLqTnal0CAZOD8bWrv/bprl7Tusg1H5gnasbfVY=", "type": "github" }, - "version": "89b7d29dad6708c04821cbf8ba8c80294f8d1733" + "version": "3988464c4514e441b4f81599507bdf2815b2f9e2" }, "nekowinston-wezterm-bar": { "cargoLocks": null, diff --git a/_sources/generated.nix b/_sources/generated.nix index 27bf034..c1fbcab 100644 --- a/_sources/generated.nix +++ b/_sources/generated.nix @@ -15,15 +15,15 @@ }; milspec = { pname = "milspec"; - version = "89b7d29dad6708c04821cbf8ba8c80294f8d1733"; + version = "3988464c4514e441b4f81599507bdf2815b2f9e2"; src = fetchFromGitHub { owner = "nekowinston"; repo = "milspec.nvim"; - rev = "89b7d29dad6708c04821cbf8ba8c80294f8d1733"; + rev = "3988464c4514e441b4f81599507bdf2815b2f9e2"; fetchSubmodules = false; - sha256 = "sha256-GWto6Y+2ZJXgTbOApQrhzsBT9sPENhgqoD6SSxykAVE="; + sha256 = "sha256-2U8yqLqTnal0CAZOD8bWrv/bprl7Tusg1H5gnasbfVY="; }; - date = "2024-05-30"; + date = "2024-06-08"; }; nekowinston-wezterm-bar = { pname = "nekowinston-wezterm-bar"; diff --git a/home/apps/colorscheme-sync.nix b/home/apps/colorscheme-sync.nix index 84daada..f81a636 100644 --- a/home/apps/colorscheme-sync.nix +++ b/home/apps/colorscheme-sync.nix @@ -29,7 +29,7 @@ in let queryCommand = if isLinux then - "dbus-send --session --print-reply=literal --reply-timeout=5 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' | grep -q 'uint32 1'" + "dbus-send --session --print-reply=literal --reply-timeout=5 --dest=org.freedesktop.portal.Desktop /org/freedesktop/portal/desktop org.freedesktop.portal.Settings.Read string:'org.freedesktop.appearance' string:'color-scheme' 2>/dev/null | grep -q 'uint32 1'" else if isDarwin then "defaults read -g AppleInterfaceStyle &>/dev/null" else @@ -66,7 +66,7 @@ in }; }; - xdg.configFile."fsh".source = "${milspec.src}/extras/zsh-fast-syntax-highlighting"; + xdg.configFile.fsh.source = "${milspec.src}/extras/zsh-fast-syntax-highlighting"; programs.zsh.initExtra = '' zadm_sync() { local flavor="$(dark-mode-ternary mocha latte)" diff --git a/home/apps/default.nix b/home/apps/default.nix index a646cdf..c5f1f45 100644 --- a/home/apps/default.nix +++ b/home/apps/default.nix @@ -5,12 +5,12 @@ ./colorscheme-sync.nix ./discord.nix ./fonts.nix - ./foot.nix ./git.nix ./gnome.nix ./gpg.nix ./gtk.nix ./hyprland.nix + ./kitty.nix ./kubernetes.nix ./mail.nix ./media.nix diff --git a/home/apps/foot.nix b/home/apps/foot.nix deleted file mode 100644 index 8095da2..0000000 --- a/home/apps/foot.nix +++ /dev/null @@ -1,57 +0,0 @@ -{ pkgs, ... }: -{ - programs.foot = { - enable = pkgs.stdenv.isLinux; - settings = { - main = { - term = "xterm-256color"; - - font = "Berkeley Mono:size=16,Nerd Font Symbols:size=16,Noto Color Emoji:size=16"; - dpi-aware = "yes"; - }; - - cursor = { - style = "beam"; - blink = "yes"; - }; - - scrollback.lines = 10000; - mouse.hide-when-typing = "yes"; - - colors = { - foreground = "cdd6f4"; - background = "1e1e2e"; - regular0 = "45475a"; - regular1 = "f38ba8"; - regular2 = "a6e3a1"; - regular3 = "f9e2af"; - regular4 = "89b4fa"; - regular5 = "f5c2e7"; - regular6 = "94e2d5"; - regular7 = "bac2de"; - bright0 = "585b70"; - bright1 = "f38ba8"; - bright2 = "a6e3a1"; - bright3 = "f9e2af"; - bright4 = "89b4fa"; - bright5 = "f5c2e7"; - bright6 = "94e2d5"; - bright7 = "a6adc8"; - - selection-foreground = "cdd6f4"; - selection-background = "414356"; - - search-box-no-match = "11111b f38ba8"; - search-box-match = "cdd6f4 313244"; - - jump-labels = "11111b fab387"; - urls = "89b4fa"; - }; - - key-bindings = { - search-start = "Control+Shift+f"; - show-urls-launch = "Control+Shift+o"; - }; - }; - }; -} diff --git a/home/apps/gtk.nix b/home/apps/gtk.nix index b010e24..079f303 100644 --- a/home/apps/gtk.nix +++ b/home/apps/gtk.nix @@ -28,10 +28,7 @@ in }; xdg = { - configFile."gtk-4.0/assets" = { - source = "${themeDir}/gtk-4.0/assets"; - recursive = true; - }; + configFile."gtk-4.0/assets".source = "${themeDir}/gtk-4.0/assets"; configFile."gtk-4.0/gtk.css".source = "${themeDir}/gtk-4.0/gtk.css"; configFile."gtk-4.0/gtk-dark.css".source = "${themeDir}/gtk-4.0/gtk-dark.css"; }; diff --git a/home/apps/hyprland.nix b/home/apps/hyprland.nix index 7f38385..e703f48 100644 --- a/home/apps/hyprland.nix +++ b/home/apps/hyprland.nix @@ -80,7 +80,7 @@ dwindle.preserve_split = true; windowrulev2 = [ "suppressevent maximize, class:.*" ]; bind = [ - "${modMove}, return, exec, foot" + "${modMove}, return, exec, kitty" "${modMove}, q, killactive," "${modMove}, m, exit," "${modMove}, d, togglefloating," diff --git a/home/apps/kitty.nix b/home/apps/kitty.nix new file mode 100644 index 0000000..e114387 --- /dev/null +++ b/home/apps/kitty.nix @@ -0,0 +1,97 @@ +{ + config, + lib, + pkgs, + ... +}: +let + milspec = (pkgs.callPackage ../../_sources/generated.nix { }).milspec; +in +{ + programs.kitty = { + enable = true; + font = { + name = "Berkeley Mono"; + size = 14; + }; + settings = { + placement_strategy = "top-left"; + inactive_text_alpha = "0.8"; + + active_tab_font_style = "bold"; + inactive_tab_font_style = "normal"; + + tab_bar_align = "left"; + tab_bar_edge = "bottom"; + tab_bar_style = "powerline"; + tab_bar_margin_width = "0.0"; + tab_powerline_style = "slanted"; + enabled_layouts = "splits, stack"; + + # always show tab bar + tab_bar_min_tabs = "1"; + + tab_title_template = "{index}: {title}{sup.num_windows if num_windows > 1 else ''}{activity_symbol}{bell_symbol}"; + }; + + keybindings = { + # this emulates zooming panes + "ctrl+s>z" = "toggle_layout stack"; + + # create new panes + "ctrl+s>-" = "launch --location=hsplit --cwd=current"; + "ctrl+s>\\" = "launch --location=vsplit --cwd=current"; + + # jump to other panes + "ctrl+s>h" = "neighboring_window left"; + "ctrl+s>l" = "neighboring_window right"; + "ctrl+s>k" = "neighboring_window up"; + "ctrl+s>j" = "neighboring_window down"; + "ctrl+s>q" = "focus_visible_window"; + + # move panes + "ctrl+s>ctrl+k" = "move_window up"; + "ctrl+s>ctrl+h" = "move_window left"; + "ctrl+s>ctrl+l" = "move_window right"; + "ctrl+s>ctrl+j" = "move_window down"; + + # manipulate panes + "ctrl+s>ctrl+r" = "start_resizing_window"; + "ctrl+s>r" = "layout_action rotate"; + "ctrl+s>x" = "close_window"; + + # open ui panel to move the pane somewhere else + "ctrl+s>m" = "detach_window ask"; + + # show index for easier switching, show number of panes + "ctrl+s>c" = "new_tab"; + "ctrl+s>n" = "next_tab"; + "ctrl+s>p" = "previous_tab"; + "ctrl+s>1" = "goto_tab 1"; + "ctrl+s>2" = "goto_tab 2"; + "ctrl+s>3" = "goto_tab 3"; + "ctrl+s>4" = "goto_tab 4"; + "ctrl+s>5" = "goto_tab 5"; + "ctrl+s>6" = "goto_tab 6"; + "ctrl+s>7" = "goto_tab 7"; + "ctrl+s>8" = "goto_tab 8"; + "ctrl+s>9" = "goto_tab 9"; + + "alt+enter" = "toggle_fullscreen"; + }; + extraConfig = '' + include themes.conf + ''; + }; + + xdg.configFile."kitty/themes".source = "${milspec.src}/extras/kitty"; + + services.darkman = lib.mkIf config.services.darkman.enable { + lightModeScripts.kitty-theme = '' + ${config.programs.kitty.package}/bin/kitty +kitten themes --config-file-name=themes.conf "milspec-light" + ''; + darkModeScripts.kitty-theme = '' + ${config.programs.kitty.package}/bin/kitty +kitten themes --config-file-name=themes.conf "milspec-dark" + ''; + }; +} diff --git a/home/apps/nu.nix b/home/apps/nu.nix index ed41abe..02c1e9e 100644 --- a/home/apps/nu.nix +++ b/home/apps/nu.nix @@ -76,8 +76,5 @@ in + mkCompletions completions; }; - xdg.configFile."nushell/config" = { - source = ./nu/config; - recursive = true; - }; + xdg.configFile."nushell/config".source = ./nu/config; } diff --git a/home/apps/nu/config.nu b/home/apps/nu/config.nu index 98878e3..1bbaff2 100644 --- a/home/apps/nu/config.nu +++ b/home/apps/nu/config.nu @@ -8,6 +8,8 @@ $env.PROMPT_INDICATOR_VI_INSERT = "" $env.PROMPT_INDICATOR_VI_NORMAL = "" $env.PROMPT_MULTILINE_INDICATOR = "" +let in_supported_termprogram = ($env.TERM_PROGRAM? == "WezTerm") or ($env.TERM? == "xterm-kitty"); + $env.config = { show_banner: false @@ -98,11 +100,11 @@ $env.config = { # emacs, vi edit_mode: vi # enables terminal shell integration. Off by default, as some terminals have issues with this. - shell_integration: ($env.TERM_PROGRAM == "WezTerm") + shell_integration: $in_supported_termprogram, # true or false to enable or disable right prompt to be rendered on last line of the prompt. render_right_prompt_on_last_line: false # enables keyboard enhancement protocol implemented by kitty console, only if your terminal support this. - use_kitty_protocol: ($env.TERM_PROGRAM == "WezTerm") + use_kitty_protocol: $in_supported_termprogram, # true enables highlighting of external commands in the repl resolved by which. highlight_resolved_externals: false # the maximum number of times nushell allows recursion before stopping it @@ -167,7 +169,7 @@ $env.config = { # str join # str trim # str split - correct_cursor_pos: false + correct_cursor_pos: true } style: { text: green diff --git a/home/apps/vscode.nix b/home/apps/vscode.nix index fd18a12..c89c466 100644 --- a/home/apps/vscode.nix +++ b/home/apps/vscode.nix @@ -129,18 +129,12 @@ in home.file = lib.mkIf isDarwin { "Library/Application Support/Code/User/keybindings.json".source = keybindingsJSON; "Library/Application Support/Code/User/settings.json".source = settingsJSON; - "Library/Application Support/Code/User/snippets" = { - source = snippetsDir; - recursive = true; - }; + "Library/Application Support/Code/User/snippets".source = snippetsDir; }; xdg.configFile = lib.mkIf isLinux { "Code/User/keybindings.json".source = keybindingsJSON; "Code/User/settings.json".source = settingsJSON; - "Code/User/snippets" = { - source = snippetsDir; - recursive = true; - }; + "Code/User/snippets".source = snippetsDir; }; xdg.mimeApps.defaultApplications."text/plain" = "code.desktop"; diff --git a/home/apps/wezterm.nix b/home/apps/wezterm.nix index 4c4909c..99ccfae 100644 --- a/home/apps/wezterm.nix +++ b/home/apps/wezterm.nix @@ -19,10 +19,7 @@ in xdg.configFile = { "wezterm/wezterm.lua".source = mkSymlink "wezterm.lua"; - "wezterm/config" = { - source = mkSymlink "config"; - recursive = true; - }; + "wezterm/config".source = mkSymlink "config"; "wezterm/bar".source = srcs.nekowinston-wezterm-bar.src; "wezterm/milspec".source = srcs.milspec.src + "/extras/wezterm"; }; diff --git a/home/default.nix b/home/default.nix index 64ad222..bd60ddb 100644 --- a/home/default.nix +++ b/home/default.nix @@ -53,10 +53,7 @@ in }; home.mac-wallpaper = ./wallpapers/dhm_1610.png; - xdg.configFile.sketchybar = { - recursive = true; - source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/sketchybar"; - }; + xdg.configFile.sketchybar.source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/sketchybar"; programs = { home-manager.enable = true;