feat: fish: cleanup config && add Ghostty support

This commit is contained in:
grassblock 2024-12-28 12:17:33 +08:00
parent ebdaf57460
commit 4563589831

View file

@ -1,14 +1,5 @@
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
@ -20,16 +11,25 @@ end
set -gx STARSHIP_CONFIG $__fish_config_dir/starship.toml
# starship custom conf end
starship init fish | source
# 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
# greeting
function fish_greeting
echo ""
# custom motd by fastfetch
if [ $TERM = xterm-kitty ]
if [ $TERM = xterm-kitty ] ; or [ $TERM = xterm-ghostty ]
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!"
echo -e "\nHellllllo from fish@$TERM, $USER!"
#cat $__fish_config_dir/motd
end
# greeting end
@ -44,27 +44,6 @@ 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"