From d7ac74ec62a3124a22bbd6a1cb5d252b15d41284 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sun, 14 Jun 2026 11:33:49 -0500 Subject: [PATCH] transfer fish/alacritty to homemanager --- home.nix | 121 ++++++++++++++++++- roy-config/alacritty/alacritty.toml | 17 --- roy-config/alacritty/catppuccin-frappe.toml | 65 ---------- roy-config/fish/config.fish | 3 - roy-config/fish/fish_variables | 32 ----- roy-config/fish/functions/fish_greeting.fish | 3 - roy-config/fish/functions/fish_prompt.fish | 83 ------------- 7 files changed, 115 insertions(+), 209 deletions(-) delete mode 100644 roy-config/alacritty/alacritty.toml delete mode 100644 roy-config/alacritty/catppuccin-frappe.toml delete mode 100644 roy-config/fish/config.fish delete mode 100644 roy-config/fish/fish_variables delete mode 100644 roy-config/fish/functions/fish_greeting.fish delete mode 100644 roy-config/fish/functions/fish_prompt.fish diff --git a/home.nix b/home.nix index 2b3d6cb..76b9b55 100755 --- a/home.nix +++ b/home.nix @@ -39,6 +39,99 @@ zip ]; + # MOVE TO IT's OWN PLACE + programs.fish = { + enable = true; + + functions.fish_greeting = ""; + functions.fish_prompt = '' + function fish_prompt --description 'Write out the prompt' + set -l last_pipestatus $pipestatus + set -lx __fish_last_status $status # Export for __fish_print_pipestatus. + set -l normal (set_color normal) + set -q fish_color_status + or set -g fish_color_status red + + # Color the prompt differently when we're root + set -l color_cwd $fish_color_cwd + set -l suffix '>' + if functions -q fish_is_root_user; and fish_is_root_user + if set -q fish_color_cwd_root + set color_cwd $fish_color_cwd_root + end + set suffix '#' + end + + # Write pipestatus + # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. + set -l bold_flag --bold + set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation + if test $__fish_prompt_status_generation = $status_generation + set bold_flag + end + set __fish_prompt_status_generation $status_generation + set -l status_color (set_color $fish_color_status) + set -l statusb_color (set_color $bold_flag $fish_color_status) + set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) + + echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " " + end + + function prompt_pwd --description 'short CWD for the prompt' + set -l options h/help d/dir-length= D/full-length-dirs= + argparse -n prompt_pwd $options -- $argv + or return + + if set -q _flag_help + __fish_print_help prompt_pwd + return 0 + end + + set -q argv[1] + or set argv $PWD + + set -ql _flag_d + and set -l fish_prompt_pwd_dir_length $_flag_d + + set -q fish_prompt_pwd_dir_length + or set -l fish_prompt_pwd_dir_length 1 + + set -l fulldirs 0 + set -ql _flag_D + and set -l fish_prompt_pwd_full_dirs $_flag_D + + set -q fish_prompt_pwd_full_dirs + or set -l fish_prompt_pwd_full_dirs 1 + + for path in $argv + # Replace $HOME with "~" + set -l realhome (string escape --style=regex -- ~) + set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $path) + + if test "$fish_prompt_pwd_dir_length" -eq 0 + echo $tmp + else + # Shorten to at most $fish_prompt_pwd_dir_length characters per directory + # with full-length-dirs components left at full length. + set -l full + if test $fish_prompt_pwd_full_dirs -gt 0 + set -l all (string split -m (math $fish_prompt_pwd_full_dirs - 1) -r / $tmp) + set tmp $all[1] + set full $all[2..] + else if test $fish_prompt_pwd_full_dirs -eq 0 + # 0 means not even the last component is kept + string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*' '$1' $tmp + continue + end + + string join / -- (string replace -ar -- '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full + end + end + end + ''; + + }; + programs.git = { enable = true; settings = { @@ -55,16 +148,32 @@ }; + programs.alacritty = { + enable = true; + theme = "catpuccin_frappe"; + + settings = { + terminal.shell = "fish"; + + font = { + normal.family = "UbuntuMono Nerd Font"; + normal.italic = "UbuntuMono Nerd Font"; + normal.bold = "UbuntuMono Nerd Font"; + size = 16; + }; + + window = { + decorations = "full"; + opacity = 1; + }; + }; + + }; + # user program config files home.file = { ".config/hypr".source = ./roy-config/hypr; ".config/waybar".source = ./roy-config/waybar; - - # Fish cries if whole dir is managed - ".config/fish/config.fish".source = ./roy-config/fish/config.fish; - ".config/fish/functions".source = ./roy-config/fish/functions; - ".config/fish/fish_variables".source = ./roy-config/fish/fish_variables; - ".config/alacritty".source = ./roy-config/alacritty; ".local/share/PrismLauncher/instances/1.21.6/minecraft/options.txt".source = ./roy-config/PrismLauncher/instances/1.21.6/minecraft/options.txt; diff --git a/roy-config/alacritty/alacritty.toml b/roy-config/alacritty/alacritty.toml deleted file mode 100644 index 329f378..0000000 --- a/roy-config/alacritty/alacritty.toml +++ /dev/null @@ -1,17 +0,0 @@ -[general] -import = [ - "~/.config/alacritty/catppuccin-frappe.toml" -] - -[terminal] -shell = "fish" - -[font] -normal = { family = "UbuntuMono Nerd Font" } -italic = { family = "UbuntuMono Nerd Font" } -bold = { family = "UbuntuMono Nerd Font" } -size = 16 - -[window] -decorations = "full" -opacity = 1 diff --git a/roy-config/alacritty/catppuccin-frappe.toml b/roy-config/alacritty/catppuccin-frappe.toml deleted file mode 100644 index 3e6fac1..0000000 --- a/roy-config/alacritty/catppuccin-frappe.toml +++ /dev/null @@ -1,65 +0,0 @@ -[colors.primary] -background = "#303446" -foreground = "#c6d0f5" -dim_foreground = "#838ba7" -bright_foreground = "#c6d0f5" - -[colors.cursor] -text = "#303446" -cursor = "#f2d5cf" - -[colors.vi_mode_cursor] -text = "#303446" -cursor = "#babbf1" - -[colors.search.matches] -foreground = "#303446" -background = "#a5adce" - -[colors.search.focused_match] -foreground = "#303446" -background = "#a6d189" - -[colors.footer_bar] -foreground = "#303446" -background = "#a5adce" - -[colors.hints.start] -foreground = "#303446" -background = "#e5c890" - -[colors.hints.end] -foreground = "#303446" -background = "#a5adce" - -[colors.selection] -text = "#303446" -background = "#f2d5cf" - -[colors.normal] -black = "#51576d" -red = "#e78284" -green = "#a6d189" -yellow = "#e5c890" -blue = "#8caaee" -magenta = "#f4b8e4" -cyan = "#81c8be" -white = "#b5bfe2" - -[colors.bright] -black = "#626880" -red = "#e78284" -green = "#a6d189" -yellow = "#e5c890" -blue = "#8caaee" -magenta = "#f4b8e4" -cyan = "#81c8be" -white = "#a5adce" - -[[colors.indexed_colors]] -index = 16 -color = "#ef9f76" - -[[colors.indexed_colors]] -index = 17 -color = "#f2d5cf" diff --git a/roy-config/fish/config.fish b/roy-config/fish/config.fish deleted file mode 100644 index d714361..0000000 --- a/roy-config/fish/config.fish +++ /dev/null @@ -1,3 +0,0 @@ -if status is-interactive - # Commands to run in interactive sessions can go here -end diff --git a/roy-config/fish/fish_variables b/roy-config/fish/fish_variables deleted file mode 100644 index 84c8273..0000000 --- a/roy-config/fish/fish_variables +++ /dev/null @@ -1,32 +0,0 @@ -# This file contains fish universal variable definitions. -# VERSION: 3.0 -SETUVAR __fish_initialized:3800 -SETUVAR fish_color_autosuggestion:brblack -SETUVAR fish_color_cancel:\x2dr -SETUVAR fish_color_command:normal -SETUVAR fish_color_comment:red -SETUVAR fish_color_cwd:green -SETUVAR fish_color_cwd_root:red -SETUVAR fish_color_end:green -SETUVAR fish_color_error:brred -SETUVAR fish_color_escape:brcyan -SETUVAR fish_color_history_current:\x2d\x2dbold -SETUVAR fish_color_host:normal -SETUVAR fish_color_host_remote:yellow -SETUVAR fish_color_normal:normal -SETUVAR fish_color_operator:brcyan -SETUVAR fish_color_param:cyan -SETUVAR fish_color_quote:yellow -SETUVAR fish_color_redirection:cyan\x1e\x2d\x2dbold -SETUVAR fish_color_search_match:white\x1e\x2d\x2dbackground\x3dbrblack -SETUVAR fish_color_selection:white\x1e\x2d\x2dbold\x1e\x2d\x2dbackground\x3dbrblack -SETUVAR fish_color_status:red -SETUVAR fish_color_user:brgreen -SETUVAR fish_color_valid_path:\x2d\x2dunderline -SETUVAR fish_key_bindings:fish_default_key_bindings -SETUVAR fish_pager_color_completion:normal -SETUVAR fish_pager_color_description:yellow\x1e\x2di -SETUVAR fish_pager_color_prefix:normal\x1e\x2d\x2dbold\x1e\x2d\x2dunderline -SETUVAR fish_pager_color_progress:brwhite\x1e\x2d\x2dbackground\x3dcyan -SETUVAR fish_pager_color_selected_background:\x2dr -SETUVAR fish_prompt_pwd_dir_length:100 diff --git a/roy-config/fish/functions/fish_greeting.fish b/roy-config/fish/functions/fish_greeting.fish deleted file mode 100644 index 0f83e89..0000000 --- a/roy-config/fish/functions/fish_greeting.fish +++ /dev/null @@ -1,3 +0,0 @@ -function fish_greeting - # echo (set_color yellow)(date +%T) -end diff --git a/roy-config/fish/functions/fish_prompt.fish b/roy-config/fish/functions/fish_prompt.fish deleted file mode 100644 index e436fa1..0000000 --- a/roy-config/fish/functions/fish_prompt.fish +++ /dev/null @@ -1,83 +0,0 @@ -function fish_prompt --description 'Write out the prompt' - set -l last_pipestatus $pipestatus - set -lx __fish_last_status $status # Export for __fish_print_pipestatus. - set -l normal (set_color normal) - set -q fish_color_status - or set -g fish_color_status red - - # Color the prompt differently when we're root - set -l color_cwd $fish_color_cwd - set -l suffix '>' - if functions -q fish_is_root_user; and fish_is_root_user - if set -q fish_color_cwd_root - set color_cwd $fish_color_cwd_root - end - set suffix '#' - end - - # Write pipestatus - # If the status was carried over (if no command is issued or if `set` leaves the status untouched), don't bold it. - set -l bold_flag --bold - set -q __fish_prompt_status_generation; or set -g __fish_prompt_status_generation $status_generation - if test $__fish_prompt_status_generation = $status_generation - set bold_flag - end - set __fish_prompt_status_generation $status_generation - set -l status_color (set_color $fish_color_status) - set -l statusb_color (set_color $bold_flag $fish_color_status) - set -l prompt_status (__fish_print_pipestatus "[" "]" "|" "$status_color" "$statusb_color" $last_pipestatus) - - echo -n -s (prompt_login)' ' (set_color $color_cwd) (prompt_pwd) $normal (fish_vcs_prompt) $normal " "$prompt_status $suffix " " -end - -function prompt_pwd --description 'short CWD for the prompt' - set -l options h/help d/dir-length= D/full-length-dirs= - argparse -n prompt_pwd $options -- $argv - or return - - if set -q _flag_help - __fish_print_help prompt_pwd - return 0 - end - - set -q argv[1] - or set argv $PWD - - set -ql _flag_d - and set -l fish_prompt_pwd_dir_length $_flag_d - - set -q fish_prompt_pwd_dir_length - or set -l fish_prompt_pwd_dir_length 1 - - set -l fulldirs 0 - set -ql _flag_D - and set -l fish_prompt_pwd_full_dirs $_flag_D - - set -q fish_prompt_pwd_full_dirs - or set -l fish_prompt_pwd_full_dirs 1 - - for path in $argv - # Replace $HOME with "~" - set -l realhome (string escape --style=regex -- ~) - set -l tmp (string replace -r '^'"$realhome"'($|/)' '~$1' $path) - - if test "$fish_prompt_pwd_dir_length" -eq 0 - echo $tmp - else - # Shorten to at most $fish_prompt_pwd_dir_length characters per directory - # with full-length-dirs components left at full length. - set -l full - if test $fish_prompt_pwd_full_dirs -gt 0 - set -l all (string split -m (math $fish_prompt_pwd_full_dirs - 1) -r / $tmp) - set tmp $all[1] - set full $all[2..] - else if test $fish_prompt_pwd_full_dirs -eq 0 - # 0 means not even the last component is kept - string replace -ar '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*' '$1' $tmp - continue - end - - string join / -- (string replace -ar -- '(\.?[^/]{'"$fish_prompt_pwd_dir_length"'})[^/]*/' '$1/' $tmp) $full - end - end -end