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,5 +1,16 @@
if status is-interactive if status is-interactive
# Commands to run in interactive sessions can go here # Commands to run in interactive sessions can go here
# 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
# set theme # set theme
if string match -q -- light (darkman get) if string match -q -- light (darkman get)
@ -9,27 +20,16 @@ if status is-interactive
end end
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 # greeting
function fish_greeting function fish_greeting
echo "" echo ""
# custom motd by fastfetch # custom motd by fastfetch
if [ $TERM = xterm-kitty ] if [ $TERM = xterm-kitty ] ; or [ $TERM = xterm-ghostty ]
fastfetch -c $__fish_config_dir/fmotd/motd.jsonc fastfetch -c $__fish_config_dir/fmotd/motd.jsonc
else else
fastfetch -c $__fish_config_dir/fmotd/motd-fallback.jsonc fastfetch -c $__fish_config_dir/fmotd/motd-fallback.jsonc
end end
echo -e "\nWelcome to fish@$TERM, $USER!" echo -e "\nHellllllo from fish@$TERM, $USER!"
#cat $__fish_config_dir/motd #cat $__fish_config_dir/motd
end end
# greeting end # greeting end
@ -44,27 +44,6 @@ end
# nvm managed npm # nvm managed npm
set -gx PATH "/home/grassblock/.local/share/npm/bin" $PATH 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 # ssh agent with rbw
set -gx SSH_ASKPASS_REQUIRE prefer set -gx SSH_ASKPASS_REQUIRE prefer
set -gx SSH_ASKPASS "$HOME/.local/bin/bw-askpass" set -gx SSH_ASKPASS "$HOME/.local/bin/bw-askpass"