update shell config

This commit is contained in:
2026-07-27 02:53:24 +02:00
parent 678cfb76ba
commit 21e902bd61
24 changed files with 300 additions and 634 deletions
+11
View File
@@ -0,0 +1,11 @@
*
!.gitignore
!05-done.fish
!10-env.fish
!10-kitty.fish
!10-niri-env.fish
!10-sshs.fish
!50-prompt.fish
!50-theme.fish
!60-alias.fish
!60-fetch.fish
@@ -0,0 +1,39 @@
# PATH is managed by .bash_profile
# man
if type -q bat
set -x -g MANPAGER "sh -c 'col -bx | bat -l man -p'"
set -x -g MANROFFOPT -c
end
# Editor
for app in helix nvim vim vi nano
if type -q $app
set -x -g EDITOR $app
set -x -g VISUAL $app
break
end
end
# Create shortcut alias for helix
if type -q helix; and not type -q hx
alias hx helix
end
# gpg
set -x -g GPG_TTY (tty)
# done
set -U __done_min_cmd_duration 10000
set -U __done_notification_urgency_level low
# fnm
if type -q fnm
fnm env --shell fish --use-on-cd | source
end
# bat
if type -q bat
set -xg BAT_THEME "Catppuccin Mocha"
set -xg BAT_STYLE "default,-numbers"
end
@@ -0,0 +1,18 @@
# ssh with encrypted private keys
# $uy_ssh_keys should be set in a device-specific file or left empty for defaults
if test "$UY_ENABLE_GPG_AGENT_SSH" = 1;\
and test -x "$HOME/.local/scripts/gpg-init"; and type -q gpgconf
true # GPG agent handles SSH — nothing to do
else if test "$UY_USING_SSH_AGENT" = 1
# avoid entering passphrase every time
function sshs
# test if keys are added to ssh-agent
if not ssh-add -l > /dev/null 2>&1
ssh-add $uy_ssh_keys
end
ssh $argv
end
end
@@ -0,0 +1,15 @@
function fish_prompt -d "Write out the prompt"
printf '%s@%s %s%s%s > ' $USER $hostname \
(set_color $fish_color_cwd) (prompt_pwd) (set_color normal)
end
# oh-my-posh
if test -f $HOME/.config/posh_theme.omp.json; and type -q oh-my-posh
eval (oh-my-posh init fish --config $HOME/.config/posh_theme.omp.json)
else if type -q starship
function starship_transient_prompt_func
starship module character
end
eval (starship init fish)
enable_transience
end
@@ -0,0 +1,10 @@
set -l target_ver 4.3.0
if test (string join \n $FISH_VERSION $target_ver | sort -V | tail -n 1) = $target_ver
set -l theme 'Catppuccin Mocha'
if not set -q fish_current_theme; or not string match -q "$theme" "$fish_current_theme"
set -U fish_current_theme "$theme"
fish_config theme save "$theme"
end
end
@@ -0,0 +1,84 @@
# fzf
if type -q fzf
fzf --fish | source
# use fd if available
if type -q fd
set -g FD_CMD "fd"
else if type -q fdfind
set -g FD_CMD "fdfind"
end
if test -n "$FD_CMD"
set -x FZF_DEFAULT_COMMAND "$FD_CMD --type f --hidden --exclude .git"
set -x FZF_CTRL_T_COMMAND "$FZF_DEFAULT_COMMAND"
set -x FZF_ALT_C_COMMAND "$FD_CMD --type d --hidden --exclude .git"
end
# C-y to copy fzf's output
if type -q wl-copy
set -x FZF_DEFAULT_OPTS "--bind \"ctrl-y:execute-silent(echo -n {+} | wl-copy)+abort\""
end
end
# cd
if type -q zoxide
zoxide init fish | source
alias cd=z
end
# rm
# if type -q trash
# alias rm="echo \"use 'trash' instead :)\" && sh -c \"exit 42\""
# end
# ls
if type -q eza
alias ls="eza --color=auto --hyperlink=auto"
alias ll="eza -lh --group-directories-first --icons=auto --hyperlink=auto"
alias la="eza -lh --group-directories-first --icons=auto --hyperlink=auto --all"
alias lt="eza --tree --level=2 --long --icons --git --hyperlink=auto"
else
alias ls="ls --color=auto --hyperlink=auto"
alias ll="ls -lh --group-directories-first --color=auto --hyperlink=auto"
alias la="ls -lah --group-directories-first --color=auto --hyperlink=auto"
end
# directories
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
# colorize
alias grep="grep --color=auto"
alias dir="dir --color=auto"
alias vdir="vdir --color=auto"
alias fgrep="fgrep --color=auto"
alias egrep="egrep --color=auto"
alias diff="diff --color=auto"
# wget
if type -q wget
alias wget="wget -c"
end
# Sort pacman packages by size
if type -q expac
alias big="expac -H M '%m\t%n' | sort -h | nl"
end
# clock
if type -q tty-clock
alias clock="tty-clock -c -C 4"
end
# journalctl
alias jctl="journalctl -p 3 -xb"
# nohup
function nh
nohup $argv >/dev/null 2>&1 & disown
end
# ffmpeg
alias ffmpeg="ffmpeg -hide_banner -nostdin"
alias ffprobe="ffprobe -hide_banner"
@@ -0,0 +1,46 @@
if not set -q fetch_logo_type
if type -q kgp-query; and kgp-query
set -g fetch_logo_type kitty
else if type -q sixel-query; and sixel-query
set -g fetch_logo_type sixel
else if type -q kgp-query; or type -q sixel-query
set -g fetch_logo_type logo
else
set -g fetch_logo_type auto
end
end
if not set -q fetch_color
set -g fetch_color "38;2;137;180;250"
end
if test "$fetch_logo_type" = symbols
set -g fetch_args "--logo-type raw --logo-width 42 --logo \"$HOME/.config/fastfetch/logo_ros/42x.symbols\" --color \"$fetch_color\""
set -g fetch_args_brief "--logo-type raw --logo-width 28 --logo \"$HOME/.config/fastfetch/logo_ros/28x.symbols\" --color \"$fetch_color\""
else if test "$fetch_logo_type" = logo
set -g fetch_args "--logo-type builtin"
set -g fetch_args_brief "--logo-type small"
else if test "$fetch_logo_type" = sixel
set -g fetch_args "--logo-type raw --logo-width 42 --logo \"$HOME/.config/fastfetch/logo_ros/42x.sixel\" --color \"$fetch_color\""
set -g fetch_args_brief "--logo-type raw --logo-width 28 --logo \"$HOME/.config/fastfetch/logo_ros/28x.sixel\" --color \"$fetch_color\""
else # "kitty" or "auto" and others
set -g fetch_args "--logo-type $fetch_logo_type --logo-width 42 --logo \"$HOME/.config/fastfetch/logo_ros/ros.png\" --color \"$fetch_color\""
set -g fetch_args_brief "--logo-type $fetch_logo_type --logo-width 28 --logo \"$HOME/.config/fastfetch/logo_ros/ros.png\" --color \"$fetch_color\""
end
if type -q fastfetch
alias ff="fastfetch -c $HOME/.config/fastfetch/config.jsonc $fetch_args"
if test -f "$HOME/.config/fastfetch/brief.jsonc"
alias ffb="fastfetch -c $HOME/.config/fastfetch/brief.jsonc $fetch_args_brief"
else
alias ffb=ff
end
end
# add 'set -g no_fetch' somewhere other than post.d to disable fetching
if not set -q no_fetch
if type -q ffb
ffb
end
end