From 879d391e1a34c193a8110ccc04abe17378a82d5f Mon Sep 17 00:00:00 2001 From: Sean Kovacs Date: Thu, 19 Feb 2026 11:30:42 -0500 Subject: [PATCH] use base16 for fish --- home/terminal/fish.nix | 21 ++++++++++++++++++- home/terminal/fish_functions/fish-prompt.fish | 10 ++++----- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/home/terminal/fish.nix b/home/terminal/fish.nix index 03f177e..ca784f0 100644 --- a/home/terminal/fish.nix +++ b/home/terminal/fish.nix @@ -1,4 +1,9 @@ -{ pkgs, ... }: +{ + pkgs, + config, + lib, + ... +}: { home.packages = with pkgs; [ kdePackages.qttools @@ -14,6 +19,7 @@ gzip = "pigz"; ls = "eza"; gl = "git log"; + gd = "git diff"; ga = "git add -v ."; gac = "git add -v . && git commit"; gaca = "git add -v . && git commit --amend --no-edit"; @@ -39,5 +45,18 @@ }; }; }; + + home.file.".config/fish/colors.fish" = { + text = lib.concatStringsSep "\n" ( + lib.mapAttrsToList (name: value: "set -g color_${name} ${value}") ( + lib.filterAttrs ( + n: v: builtins.isString v && builtins.match "^base[0-9A-Fa-f]{2}$" n != null + ) config.scheme + ) + ++ [ "set -g color_accent ${config.scheme.${config.colors.accent}}" ] + ); + force = true; + }; + programs.man.generateCaches = false; } diff --git a/home/terminal/fish_functions/fish-prompt.fish b/home/terminal/fish_functions/fish-prompt.fish index e13d31d..2f4fca7 100644 --- a/home/terminal/fish_functions/fish-prompt.fish +++ b/home/terminal/fish_functions/fish-prompt.fish @@ -1,4 +1,4 @@ -# source ~/.config/fish/colors.fish +source ~/.config/fish/colors.fish set -l last_status $status set -l nix_shell_info ( if test -n "$IN_NIX_SHELL" @@ -11,14 +11,14 @@ set -g color_cwd green # Set host color based on hostname if test (hostname) = peach - set -g color_host yellow + set -g color_host $color_accent else if test (hostname) = alien - set -g color_host yellow + set -g color_host $color_accent else if test (hostname) = vm - set -g color_host yellow + set -g color_host $color_accent set -g color_cwd normal else if test (uname) = Darwin - set -g color_host yellow + set -g color_host $color_base0A end set -l user_host (set_color $color_user)"$USER"(set_color normal)"@"(set_color $color_host)(prompt_hostname)(set_color normal)