dots/home/private_dot_config/private_fish/config.fish
2024-12-13 23:13:04 +08:00

96 lines
2.6 KiB
Fish

if status is-interactive
# Commands to run in interactive sessions can go here
# set theme
if string match -q -- light (darkman get)
yes | fish_config theme save "ayu Light"
else
yes | fish_config theme save "Nord"
end
end
# zellij init for alacritty
if string match -q -- alacritty $TERM
set -gx ZELLIJ_AUTO_EXIT true
eval (zellij setup --generate-auto-start fish | string collect)
end
# zellij init for alacritty end
# starship custom conf
set -gx STARSHIP_CONFIG $__fish_config_dir/starship.toml
# starship custom conf end
starship init fish | source
# greeting
function fish_greeting
echo ""
# custom motd by fastfetch
if [ $TERM = xterm-kitty ]
fastfetch -c $__fish_config_dir/fmotd/motd.jsonc
else
fastfetch -c $__fish_config_dir/fmotd/motd-fallback.jsonc
end
echo -e "\nWelcome to fish@$TERM, $USER!"
#cat $__fish_config_dir/motd
end
# greeting end
# pnpm
set -gx PNPM_HOME "/home/grassblock/.local/share/pnpm"
if not string match -q -- $PNPM_HOME $PATH
set -gx PATH "$PNPM_HOME" $PATH
end
# pnpm end
# nvm managed npm
set -gx PATH "/home/grassblock/.local/share/npm/bin" $PATH
# ssh-agent
#set SSH_ENV_FILE "$HOME/.ssh/agent-environment"
#set SSH_TIMEOUT 86400 # 24 hours in seconds
#function ssh_start_agent
# ssh-agent -c -t "$SSH_TIMEOUT" > "$SSH_ENV_FILE"
# chmod 600 "$SSH_ENV_FILE"
# source "$SSH_ENV_FILE"
# ssh-add # [<id_rsa_path>] Change to your path
#end
#if test -f "$SSH_ENV_FILE"
# source "$SSH_ENV_FILE"
# if not ps -p "$SSH_AGENT_PID" > /dev/null
# ssh_start_agent
# end
#else
# ssh_start_agent
#end
## ssh-agent-end
# ssh agent with rbw
set -gx SSH_ASKPASS_REQUIRE prefer
set -gx SSH_ASKPASS "$HOME/.local/bin/bw-askpass"
# Created by `pipx` on 2023-10-13 01:41:55
set PATH $PATH /home/grassblock/.local/bin
# pipx end
# >>> mamba initialize >>>
# !! Contents within this block are managed by 'mamba init' !!
set -gx MAMBA_EXE "/usr/bin/micromamba"
set -gx MAMBA_ROOT_PREFIX "/home/grassblock/.local/share/micromamba"
$MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source
# <<< mamba initialize <<<
# micromamba has outdated dependency,,,,
# asdf
set -gx ASDF_CONFIG_FILE $XDG_CONFIG_HOME/asdf/asdfrc
set -gx ASDF_DATA_DIR $XDG_DATA_HOME/asdf
source /opt/asdf-vm/asdf.fish
# asdf end
# alias
alias wget "wget --hsts-file="$XDG_DATA_HOME/wget-hsts""
alias "yarn" "yarn $1 --use-yarnrc $XDG_CONFIG_HOME/yarn/config"
alias "ssh" "kitten ssh"
alias "nya" "echo nya && meow"
alias bat="bat --theme=\$( test $(darkman get) = 'dark' && echo Nord || echo ansi)"
# alias end