Update .config/fish/conf.d/10-starship.fish

Update .config/fish/conf.d/20-gpg.fish
Update .config/fish/conf.d/30-chezmoi.fish
Update .config/fish/conf.d/30-eza.fish
Update .config/fish/conf.d/30-fzf.fish
Update .config/fish/conf.d/30-git.fish
Update .config/fish/conf.d/30-go.fish
Update .config/fish/conf.d/30-journalctl.fish
Update .config/fish/conf.d/30-lazygit.fish
Update .config/fish/conf.d/30-less.fish
Update .config/fish/conf.d/30-php.fish
Remove .config/fish/conf.d/30-polybar.fish
Update .config/fish/conf.d/30-systemctl.fish
Update .config/fish/conf.d/30-volta.fish
Update .config/fish/conf.d/30-wget.fish
Update .config/fish/conf.d/30-yay.fish
Update .config/fish/conf.d/30-bitwarden.fish
Update .config/topgrade.d/01-commands.toml
This commit is contained in:
punkfairie 2024-10-02 21:01:45 -07:00
parent 3f10356bd2
commit 91ce6c48d6
Signed by: punkfairie
GPG key ID: A86AF57F837E320F
18 changed files with 155 additions and 132 deletions

View file

@ -1,10 +1,12 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function starship_transient_prompt_func if command -v starship &>/dev/null
starship module character function starship_transient_prompt_func
end starship module character
end
if status is-interactive if status is-interactive
starship init fish | source starship init fish | source
enable_transience enable_transience
end
end end

View file

@ -1,6 +1,6 @@
#!/usr/bin/env fish #!/usr/bin/env fish
if test "$(command -v gpgconf &>/dev/null)" if command -v gpgconf &>/dev/null
set -gx GPG_TTY (tty) set -gx GPG_TTY (tty)
gpgconf --launch gpg-agent gpgconf --launch gpg-agent
end end

View file

@ -1,12 +1,14 @@
#!/usr/bin/env fish #!/usr/bin/env fish
abbr -a cz --position command chezmoi if command -v chezmoi &>/dev/null
abbr -a czap --position command "chezmoi apply" abbr -a cz --position command chezmoi
abbr -a cza --position command "chezmoi add" abbr -a czap --position command "chezmoi apply"
abbr -a czc --position command "chezmoi cd" abbr -a cza --position command "chezmoi add"
abbr -a cze --position command "chezmoi edit" abbr -a czc --position command "chezmoi cd"
abbr -a czu --position command "chezmoi update" abbr -a cze --position command "chezmoi edit"
abbr -a czu --position command "chezmoi update"
abbr -a czct --position command "chezmoi chattr +t" abbr -a czct --position command "chezmoi chattr +t"
abbr -a czcm --position command 'git aa && git c -m "$(chezmoi generate git-commit-message)" && git p' abbr -a czcm --position command 'git aa && git c -m "$(chezmoi generate git-commit-message)" && git p'
end

View file

@ -1,18 +1,20 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function ls --wraps eza if command -v eza &>/dev/null
eza --all --icons=auto --sort=name --group-directories-first $argv function ls --wraps eza
end eza --all --icons=auto --sort=name --group-directories-first $argv
end
function lst --wraps eza function lst --wraps eza
ls --tree --color=always $argv ls --tree --color=always $argv
end end
function lsl --wraps eza function lsl --wraps eza
eza --all --icons=auto --sort=name --group-directories-first --grid --long \ eza --all --icons=auto --sort=name --group-directories-first --grid --long \
--git --header $argv --git --header $argv
end end
function lslt --wraps eza function lslt --wraps eza
lsl --tree --color=always $argv lsl --tree --color=always $argv
end
end end

View file

@ -1,8 +1,11 @@
#!/usr/bin/env fish #!/usr/bin/env fish
set -gx FZF_DEFAULT_CMD 'rg --files --hidden --glob "!.git"' if command -v fzf &>/dev/null
if command -v rg &>/dev/null
set -gx FZF_DEFAULT_CMD 'rg --files --hidden --glob "!.git"'
end
set -gx FZF_DEFAULT_OPTS "\ set -gx FZF_DEFAULT_OPTS "\
--margin=10%,5% \ --margin=10%,5% \
--border=sharp \ --border=sharp \
--pointer=' ' \ --pointer=' ' \
@ -14,6 +17,11 @@ set -gx FZF_DEFAULT_OPTS "\
--color=fg:{{ .drapeau.colors.base05 }},header:{{ .drapeau.colors.base08 }},info:{{ .drapeau.colors.base0E }},pointer:{{ .drapeau.colors.base06 }} \ --color=fg:{{ .drapeau.colors.base05 }},header:{{ .drapeau.colors.base08 }},info:{{ .drapeau.colors.base0E }},pointer:{{ .drapeau.colors.base06 }} \
--color=marker:{{ .drapeau.colors.base06 }},fg+:{{ .drapeau.colors.base05 }},prompt:{{ .drapeau.colors.base0E }},hl+:{{ .drapeau.colors.base08 }}" --color=marker:{{ .drapeau.colors.base06 }},fg+:{{ .drapeau.colors.base05 }},prompt:{{ .drapeau.colors.base0E }},hl+:{{ .drapeau.colors.base08 }}"
# fzf.fish # fzf.fish
set -g fzf_preview_dir_cmd eza --all --color=always --sort=name --group-directories-first if command -v eza &>/dev/null
set -g fzf_diff_highlighter delta --paging=never --features=arctic-fox set -g fzf_preview_dir_cmd eza --all --color=always --sort=name --group-directories-first
end
if command -v delta &>/dev/null
set -g fzf_diff_highlighter delta --paging=never --features=arctic-fox
end
end

View file

@ -1,50 +1,52 @@
#!/usr/bin/env fish #!/usr/bin/env fish
abbr -a g --position command git if command -v git &>/dev/null
abbr -a g --position command git
################################################################################ ############################################################################
# Functions # # Functions #
################################################################################ ############################################################################
function git_develop_branch function git_develop_branch
command git rev-parse --git-dir &>/dev/null || return command git rev-parse --git-dir &>/dev/null || return
set -l branch set -l branch
for branch in dev devel develop development for branch in dev devel develop development
if command git show-ref -q --verify refs/heads/$branch if command git show-ref -q --verify refs/heads/$branch
echo $branch echo $branch
return 0 return 0
end
end end
echo develop
return 1
end end
echo develop function git_main_branch
return 1 command git rev-parse --git-dir &>/dev/null || return
end set -l ref
function git_main_branch for ref in
command git rev-parse --git-dir &>/dev/null || return refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}
set -l ref if command git show-ref -q --verify $ref
echo (basename $ref)
for ref in return 0
refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master} end
if command git show-ref -q --verify $ref
echo (basename $ref)
return 0
end end
echo main
return 1
end end
echo main function git_current_branch
return 1 set -l ref (git symbolic-ref --quiet HEAD 2>/dev/null)
end set -l ret $status
function git_current_branch if [ $ret -ne 0 ]
set -l ref (git symbolic-ref --quiet HEAD 2>/dev/null) [ $ret -eq 128 ] && return # no git repo
set -l ret $status set ref (git rev-parse --short HEAD 2>/dev/null) || return
end
if [ $ret -ne 0 ] echo (string replace "refs/heads/" "" $ref)
[ $ret -eq 128 ] && return # no git repo
set ref (git rev-parse --short HEAD 2>/dev/null) || return
end end
echo (string replace "refs/heads/" "" $ref)
end end

View file

@ -1,3 +1,5 @@
#!/usr/bin/env fish #!/usr/bin/env fish
fish_add_path "$HOME/go/bin" if command -v go &>/dev/null
fish_add_path "$HOME/go/bin"
end

View file

@ -1,4 +1,6 @@
#!/usr/bin/env fish #!/usr/bin/env fish
abbr -a jf --position command "sudo journalctl --follow --unit" if command -v journalctl &>/dev/null
abbr -a je --position command "sudo journalctl --pager-end --unit" abbr -a jf --position command "sudo journalctl --follow --unit"
abbr -a je --position command "sudo journalctl --pager-end --unit"
end

View file

@ -1,11 +1,13 @@
#!/usr/bin/env fish #!/usr/bin/env fish
function lzg --wraps=lazygit if command -v lazygit &>/dev/null
{{ if eq .drapeau.colors.name "catppuccin" -}} function lzg --wraps=lazygit
set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml,$XDG_CONFIG_HOME/lazygit/{{ .drapeau.colors.name }}/themes-mergable/{{ .drapeau.colors.flavor }}/pink.yml" {{ if eq .drapeau.colors.name "catppuccin" -}}
{{ else -}} set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml,$XDG_CONFIG_HOME/lazygit/{{ .drapeau.colors.name }}/themes-mergable/{{ .drapeau.colors.flavor }}/pink.yml"
set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml" {{ else -}}
{{ end -}} set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml"
{{ end -}}
lazygit --use-config-file="$configs" lazygit --use-config-file="$configs"
end
end end

View file

@ -1,19 +1,19 @@
#!/usr/bin/env fish #!/usr/bin/env fish
set -gx LESS -R if command -v less &>/dev/null
set -gx LESS -R
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
abbr -a L --position anywhere --set-cursor "% | less" abbr -a L --position anywhere --set-cursor "% | less"
function lessv if command -v nvim &>/dev/null
if ! command -v nvim &>/dev/null function lessv
return if test -e "/usr/share/nvim/runtime/macros/less.sh"
end /usr/share/nvim/runtime/macros/less.sh $argv
else if test -e "/usr/local/share/nvim/runtime/macros/less.sh"
if test -e "/usr/share/nvim/runtime/macros/less.sh" /usr/local/share/nvim/runtime/macros/less.sh $argv
/usr/share/nvim/runtime/macros/less.sh $argv end
else if test -e "/usr/local/share/nvim/runtime/macros/less.sh" end
/usr/local/share/nvim/runtime/macros/less.sh $argv
end end
end end

View file

@ -1,7 +1,11 @@
#!/usr/bin/env fish #!/usr/bin/env fish
fish_add_path "$HOME/.config/composer/vendor/bin" if command -v composer &>/dev/null
fish_add_path "$HOME/.config/composer/vendor/bin"
end
abbr -a p --position command php if command -v php &>/dev/null
abbr -a pa --position command "php artisan" abbr -a p --position command php
abbr -a a --position command "php artisan" abbr -a pa --position command "php artisan"
abbr -a a --position command "php artisan"
end

View file

@ -1,5 +0,0 @@
#!/usr/bin/env fish
function polybar-start
"$HOME/.config/polybar/launch.sh" --colorblocks &
end

View file

@ -1,9 +1,11 @@
#!/usr/bin/env fish #!/usr/bin/env fish
abbr -a sctl --position command "sudo systemctl" if command -v systemctl &>/dev/null
abbr -a sctls --position command "sudo systemctl status" abbr -a sctl --position command "sudo systemctl"
abbr -a sctle --position command "sudo systemctl enable --now" abbr -a sctls --position command "sudo systemctl status"
abbr -a sctld --position command "sudo systemctl disable --now" abbr -a sctle --position command "sudo systemctl enable --now"
abbr -a sctlr --position command "sudo systemctl restart" abbr -a sctld --position command "sudo systemctl disable --now"
abbr -a sctlo --position command "sudo systemctl stop" abbr -a sctlr --position command "sudo systemctl restart"
abbr -a sctla --position command "sudo systemctl start" abbr -a sctlo --position command "sudo systemctl stop"
abbr -a sctla --position command "sudo systemctl start"
end

View file

@ -1,5 +1,7 @@
#!/usr/bin/env fish #!/usr/bin/env fish
fish_add_path "$HOME/.volta/bin" if command -v volta &>/dev/null
fish_add_path "$HOME/.volta/bin"
set -gx VOLTA_HOME "$HOME/.volta" set -gx VOLTA_HOME "$HOME/.volta"
end

View file

@ -1,7 +1,9 @@
#!/usr/bin/env fish #!/usr/bin/env fish
set -gx WGETRC "$XDG_CONFIG_HOME/wgetrc" if command -v wget &>/dev/null
set -gx WGETRC "$XDG_CONFIG_HOME/wgetrc"
#function wget --wraps wget function wget --wraps wget
# wget --hsts-file="$XDG_CACHE_HOME/wget-hsts" $argv command wget --hsts-file="$XDG_CACHE_HOME/wget-hsts" $argv
#end end
end

View file

@ -1,13 +1,15 @@
#!/usr/bin/env fish #!/usr/bin/env fish
abbr -a y --position command yay if command -v yay
abbr -a yi --position command "yay -S" abbr -a y --position command yay
abbr -a yr --position command "yay -R" abbr -a yi --position command "yay -S"
abbr -a yc --position command "yay -Sc" abbr -a yr --position command "yay -R"
abbr -a yu --position command "yay -Syu" abbr -a yc --position command "yay -Sc"
abbr -a ys --position command "yay -Ss" abbr -a yu --position command "yay -Syu"
abbr -a ysi --position command "yay -Qs" abbr -a ys --position command "yay -Ss"
abbr -a ysi --position command "yay -Qs"
function yay-group-missing --argument-names group function yay-group-missing --argument-names group
comm -23 <(yay -Sg $group | awk '{print $2}' | sort) <(yay -Qq | sort) comm -23 <(yay -Sg $group | awk '{print $2}' | sort) <(yay -Qq | sort)
end
end end

View file

@ -1,10 +1,10 @@
-----BEGIN PGP MESSAGE----- -----BEGIN PGP MESSAGE-----
jA0ECQMIvR4z836ZO3//0sApAakbVKnuKb9TrQatlObf0ORC/qcp6yLIL7vTuRLH jA0ECQMInwAQ3xxYOS7/0sAoAWRHbdhtTICBBJCFsnNIlSUNyhCXNgduEIcgss+m
kCtX75AFRrcGlTDEPjpO261FNeoRLEZJZJ911UJgobJOOwr/yAgy4Blcf8m7NC9q 6DpDROJbe2pA+yBSntZXNO0w3VnrCYWsvurl0rDY4KFglAl+2ALrN0/9YfecAbC4
PyaJfS37+5TURWjpTmeNBCg/vyzF5IQX5lxurM524VVdl1NN0hFn1NlIrJ2OvNy+ XtutfDkAu/u6V7eLKBgovXpz6Jdt2Vtey5mkANQpD9ET+TVjPCJBhTQeSjqR886p
OnUrjtM+CWQuDvuK1RIt73A6SjXsuSIbKxSZji5HZRN9qv7Tdbmv8pKoDwtmU1ZH hQf6glkbOJOLEh11o+IvM6L7wvHG9gh8mxSVEImn8Ypd5BrnqODxeIIkEiFzTU/N
8juNFv6IA6mA0UDgScUBY6u5lOTzbcnE/UV/tjuxeUjalzuGTB5xXnH5ggw50LcG TDpiUSvILNcHDzBuUqyuKWUzS//r4+cKW6jTlOR7W5HO899uywcQodwyq4bIGoi9
yKSpNivjBe8nmgY= 12E7OpMEf5mu/Q==
=yQ/O =uySh
-----END PGP MESSAGE----- -----END PGP MESSAGE-----

View file

@ -11,9 +11,3 @@
# Custom commands # Custom commands
[commands] [commands]
"Fish Shell Completions" = "fish_update_completions" "Fish Shell Completions" = "fish_update_completions"
{{ if lookPath "yay" -}}
"Update package list" = "yay -Qeq > {{ joinPath .chezmoi.sourceDir "dot_config/packages/" .chezmoi.hostname }} && set_color green && printf '%s'  && set_color normal && printf '%s' ' done\n'"
{{ end -}}
{{if lookPath "brew" -}}
"Update Brewfile" = "brew bundle dump --describe --force --file={{ joinPath .chezmoi.sourceDir "dot_config/packages/Brewfile" }} && set_color green && printf '%s'  && set_color normal && printf '%s' ' done\n'"
{{ end -}}