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
function starship_transient_prompt_func
starship module character
end
if command -v starship &>/dev/null
function starship_transient_prompt_func
starship module character
end
if status is-interactive
starship init fish | source
enable_transience
if status is-interactive
starship init fish | source
enable_transience
end
end

View file

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

View file

@ -1,12 +1,14 @@
#!/usr/bin/env fish
abbr -a cz --position command chezmoi
abbr -a czap --position command "chezmoi apply"
abbr -a cza --position command "chezmoi add"
abbr -a czc --position command "chezmoi cd"
abbr -a cze --position command "chezmoi edit"
abbr -a czu --position command "chezmoi update"
if command -v chezmoi &>/dev/null
abbr -a cz --position command chezmoi
abbr -a czap --position command "chezmoi apply"
abbr -a cza --position command "chezmoi add"
abbr -a czc --position command "chezmoi cd"
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
function ls --wraps eza
eza --all --icons=auto --sort=name --group-directories-first $argv
end
if command -v eza &>/dev/null
function ls --wraps eza
eza --all --icons=auto --sort=name --group-directories-first $argv
end
function lst --wraps eza
ls --tree --color=always $argv
end
function lst --wraps eza
ls --tree --color=always $argv
end
function lsl --wraps eza
eza --all --icons=auto --sort=name --group-directories-first --grid --long \
--git --header $argv
end
function lsl --wraps eza
eza --all --icons=auto --sort=name --group-directories-first --grid --long \
--git --header $argv
end
function lslt --wraps eza
lsl --tree --color=always $argv
function lslt --wraps eza
lsl --tree --color=always $argv
end
end

View file

@ -1,8 +1,11 @@
#!/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% \
--border=sharp \
--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=marker:{{ .drapeau.colors.base06 }},fg+:{{ .drapeau.colors.base05 }},prompt:{{ .drapeau.colors.base0E }},hl+:{{ .drapeau.colors.base08 }}"
# fzf.fish
set -g fzf_preview_dir_cmd eza --all --color=always --sort=name --group-directories-first
set -g fzf_diff_highlighter delta --paging=never --features=arctic-fox
# fzf.fish
if command -v eza &>/dev/null
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
abbr -a g --position command git
if command -v git &>/dev/null
abbr -a g --position command git
################################################################################
# Functions #
################################################################################
############################################################################
# Functions #
############################################################################
function git_develop_branch
command git rev-parse --git-dir &>/dev/null || return
set -l branch
function git_develop_branch
command git rev-parse --git-dir &>/dev/null || return
set -l branch
for branch in dev devel develop development
if command git show-ref -q --verify refs/heads/$branch
echo $branch
return 0
for branch in dev devel develop development
if command git show-ref -q --verify refs/heads/$branch
echo $branch
return 0
end
end
echo develop
return 1
end
echo develop
return 1
end
function git_main_branch
command git rev-parse --git-dir &>/dev/null || return
set -l ref
function git_main_branch
command git rev-parse --git-dir &>/dev/null || return
set -l ref
for ref in
refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}
if command git show-ref -q --verify $ref
echo (basename $ref)
return 0
for ref in
refs/{heads,remotes/{origin,upstream}}/{main,trunk,mainline,default,master}
if command git show-ref -q --verify $ref
echo (basename $ref)
return 0
end
end
echo main
return 1
end
echo main
return 1
end
function git_current_branch
set -l ref (git symbolic-ref --quiet HEAD 2>/dev/null)
set -l ret $status
function git_current_branch
set -l ref (git symbolic-ref --quiet HEAD 2>/dev/null)
set -l ret $status
if [ $ret -ne 0 ]
[ $ret -eq 128 ] && return # no git repo
set ref (git rev-parse --short HEAD 2>/dev/null) || return
end
if [ $ret -ne 0 ]
[ $ret -eq 128 ] && return # no git repo
set ref (git rev-parse --short HEAD 2>/dev/null) || return
echo (string replace "refs/heads/" "" $ref)
end
echo (string replace "refs/heads/" "" $ref)
end

View file

@ -1,3 +1,5 @@
#!/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
abbr -a jf --position command "sudo journalctl --follow --unit"
abbr -a je --position command "sudo journalctl --pager-end --unit"
if command -v journalctl &>/dev/null
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
function lzg --wraps=lazygit
{{ if eq .drapeau.colors.name "catppuccin" -}}
set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml,$XDG_CONFIG_HOME/lazygit/{{ .drapeau.colors.name }}/themes-mergable/{{ .drapeau.colors.flavor }}/pink.yml"
{{ else -}}
set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml"
{{ end -}}
if command -v lazygit &>/dev/null
function lzg --wraps=lazygit
{{ if eq .drapeau.colors.name "catppuccin" -}}
set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml,$XDG_CONFIG_HOME/lazygit/{{ .drapeau.colors.name }}/themes-mergable/{{ .drapeau.colors.flavor }}/pink.yml"
{{ else -}}
set -f configs "$XDG_CONFIG_HOME/lazygit/config.yml"
{{ end -}}
lazygit --use-config-file="$configs"
lazygit --use-config-file="$configs"
end
end

View file

@ -1,19 +1,19 @@
#!/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
return
end
if test -e "/usr/share/nvim/runtime/macros/less.sh"
/usr/share/nvim/runtime/macros/less.sh $argv
else if test -e "/usr/local/share/nvim/runtime/macros/less.sh"
/usr/local/share/nvim/runtime/macros/less.sh $argv
if command -v nvim &>/dev/null
function lessv
if test -e "/usr/share/nvim/runtime/macros/less.sh"
/usr/share/nvim/runtime/macros/less.sh $argv
else if test -e "/usr/local/share/nvim/runtime/macros/less.sh"
/usr/local/share/nvim/runtime/macros/less.sh $argv
end
end
end
end

View file

@ -1,7 +1,11 @@
#!/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
abbr -a pa --position command "php artisan"
abbr -a a --position command "php artisan"
if command -v php &>/dev/null
abbr -a p --position command php
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
abbr -a sctl --position command "sudo systemctl"
abbr -a sctls --position command "sudo systemctl status"
abbr -a sctle --position command "sudo systemctl enable --now"
abbr -a sctld --position command "sudo systemctl disable --now"
abbr -a sctlr --position command "sudo systemctl restart"
abbr -a sctlo --position command "sudo systemctl stop"
abbr -a sctla --position command "sudo systemctl start"
if command -v systemctl &>/dev/null
abbr -a sctl --position command "sudo systemctl"
abbr -a sctls --position command "sudo systemctl status"
abbr -a sctle --position command "sudo systemctl enable --now"
abbr -a sctld --position command "sudo systemctl disable --now"
abbr -a sctlr --position command "sudo systemctl restart"
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
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
set -gx WGETRC "$XDG_CONFIG_HOME/wgetrc"
if command -v wget &>/dev/null
set -gx WGETRC "$XDG_CONFIG_HOME/wgetrc"
#function wget --wraps wget
# wget --hsts-file="$XDG_CACHE_HOME/wget-hsts" $argv
#end
function wget --wraps wget
command wget --hsts-file="$XDG_CACHE_HOME/wget-hsts" $argv
end
end

View file

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

View file

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

View file

@ -11,9 +11,3 @@
# Custom commands
[commands]
"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 -}}