update fish prompt
This commit is contained in:
parent
f6f8af69c6
commit
6da37f70b3
3 changed files with 28 additions and 11 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
{
|
{
|
||||||
config,
|
config,
|
||||||
pkgs,
|
pkgs,
|
||||||
|
lib,
|
||||||
...
|
...
|
||||||
}: {
|
}: {
|
||||||
home.packages = with pkgs; [kdePackages.qttools];
|
home.packages = with pkgs; [kdePackages.qttools];
|
||||||
|
|
@ -29,4 +30,15 @@
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
home.file.".config/fish/colors.fish" = {
|
||||||
|
text = let
|
||||||
|
flavor = config.catppuccin.flavor;
|
||||||
|
palette = pkgs.catppuccin.bare.${flavor};
|
||||||
|
in
|
||||||
|
lib.concatStringsSep "\n" (
|
||||||
|
lib.mapAttrsToList (name: value: "set -g color_${name} ${value}") palette
|
||||||
|
);
|
||||||
|
force = true;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,24 +1,28 @@
|
||||||
|
source ~/.config/fish/colors.fish
|
||||||
set -l last_status $status
|
set -l last_status $status
|
||||||
set -l nix_shell_info (
|
set -l nix_shell_info (
|
||||||
if test -n "$IN_NIX_SHELL"
|
if test -n "$IN_NIX_SHELL"
|
||||||
echo -n "<nix-shell> "
|
echo -n "<nix-shell> "
|
||||||
end
|
end
|
||||||
)
|
)
|
||||||
set -g fish_color_user 89dceb
|
set -g color_user $color_sky
|
||||||
|
set -g color_host $color_red
|
||||||
|
set -g color_cwd $color_green
|
||||||
|
|
||||||
# Set host color based on hostname
|
# Set host color based on hostname
|
||||||
if test (hostname) = "peach"
|
if test (hostname) = peach
|
||||||
set -g fish_color_host fab387
|
set -g color_host $color_peach
|
||||||
else if test (hostname) = "alien"
|
else if test (hostname) = alien
|
||||||
set -g fish_color_host 89b4fa
|
set -g color_host $color_blue
|
||||||
else if test (hostname) = "vm-aarch64"
|
else if test (hostname) = vm-aarch64
|
||||||
set -g fish_color_host a6e3a1
|
set -g color_host $color_green
|
||||||
else if test (uname) = "Darwin"
|
set -g color_cwd $color_red
|
||||||
set -g fish_color_host f9e2af
|
else if test (uname) = Darwin
|
||||||
|
set -g color_host $color_yellow
|
||||||
end
|
end
|
||||||
|
|
||||||
set -l user_host (set_color $fish_color_user)"$USER"(set_color normal)"@"(set_color $fish_color_host)(prompt_hostname)(set_color normal)
|
set -l user_host (set_color $color_user)"$USER"(set_color normal)"@"(set_color $color_host)(prompt_hostname)(set_color normal)
|
||||||
set -l cwd (set_color $fish_color_cwd)(prompt_pwd)(set_color normal)
|
set -l cwd (set_color $color_cwd)(prompt_pwd)(set_color normal)
|
||||||
set -l git_info (fish_git_prompt)
|
set -l git_info (fish_git_prompt)
|
||||||
echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info"
|
echo -s "$user_host" " " "$cwd" "$git_info $nix_shell_info"
|
||||||
echo -n -s "> "
|
echo -n -s "> "
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,7 @@
|
||||||
css = ["prettier"];
|
css = ["prettier"];
|
||||||
json = ["prettier"];
|
json = ["prettier"];
|
||||||
jsonc = ["prettier"];
|
jsonc = ["prettier"];
|
||||||
|
fish = ["fish_indent"];
|
||||||
};
|
};
|
||||||
|
|
||||||
# Default formatting options
|
# Default formatting options
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue