From aedb580510f9e8ea96ef141dadbbb09c205834ef Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Wed, 26 Mar 2025 13:01:28 -0300 Subject: [PATCH] Update bashrc to make it more flexible and add eget tools --- dot_bashrc | 36 +++++++++++++++++---------- dot_config/eget/eget.toml | 52 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 74 insertions(+), 14 deletions(-) diff --git a/dot_bashrc b/dot_bashrc index 22ffddb..b06064a 100644 --- a/dot_bashrc +++ b/dot_bashrc @@ -3,7 +3,6 @@ # Required init for cli programs # Do not install completions unless no working, check /usr/share/bash-completion -eval "$(zoxide init bash)" # Local bash-completion if [[ -f $HOME/.local/bin/bash_completion ]]; then @@ -16,19 +15,27 @@ if [[ -f $HOME/.local/share/cargo/env ]]; then fi # Set aliases -alias grep="ugrep" -alias cd="z" -alias cat="bat -p" -alias update-mirrors="rate-mirrors arch | sudo tee /etc/pacman.d/mirrorlist; rate-mirrors chaotic-aur | sudo tee /etc/pacman.d/chaotic-mirrorlist" -alias update="paru; flatpak update" +if hash rg 2>/dev/null; then + alias grep="rg" +fi +if hash bat 2>/dev/null; then + alias cat="bat -p" +fi +if hash zoxide 2>/dev/null; then + alias cd="z" +fi +alias update="eget -D; . $HOME/.config/eget/post_install.sh" alias rc="source ~/.bashrc" -function ls { - if [[ "$@" =~ "-a" || "$@" =~ "-A" || "$@" =~ "--all" || "$@" =~ "--almost-all" ]]; then - eza --icons --long $@ - else - eza --icons --long --ignore-glob "$([[ -f .hidden ]] && cat .hidden | tr '\n' '|')" $@ - fi -} +if hash eza 2>/dev/null; then + function ls { + if [[ "$@" =~ "-a" || "$@" =~ "-A" || "$@" =~ "--all" || "$@" =~ "--almost-all" ]]; then + eza --icons --long $@ + else + eza --icons --long --ignore-glob "$([[ -f .hidden ]] && cat .hidden | tr '\n' '|')" $@ + fi + } +fi + # Dotfiles management # TODO: Rewrite to use bash read instead of zsh read @@ -91,3 +98,6 @@ PS1='[\u@\h \w]\$ ' # Starship after defining custom prompt, easy to remove eval "$(starship init bash)" + +# Zoxide +eval "$(zoxide init bash)" diff --git a/dot_config/eget/eget.toml b/dot_config/eget/eget.toml index 2b2bfe1..a788374 100644 --- a/dot_config/eget/eget.toml +++ b/dot_config/eget/eget.toml @@ -1,2 +1,52 @@ [global] -target = "~/.local/bin" + target = "~/.local/bin" + upgrade_only = true + +["zyedidia/eget"] + +["zyedidia/micro"] + asset_filters = [ "static", ".tar.gz" , "^sha" ] + +["ip7z/7zip"] + # Currently not working as 7zip packages use xz filters unsupported by eget/xz go library + #file = "7zzs" + #target = "~/.local/bin/7z" + download_only = true + +["sharkdp/bat"] + asset_filters = [ "gnu", ".tar.gz" ] + +["BurntSushi/ripgrep"] + +["sharkdp/fd"] + asset_filters = [ "gnu" ] + +["sharkdp/hyperfine"] + asset_filters = [ "gnu" ] + +["ajeetdsouza/zoxide"] + +["neovim/neovim"] + asset_filters = [ "x86_64" ] + target = "~/.local/bin/nvim" + +["konosubakonoakua/ncdu-zig"] + target = "~/.local/bin/ncdu" + +["eza-community/eza"] + asset_filters = [ "gnu", ".tar.gz" ] + +["starship/starship"] + asset_filters = [ "gnu" ] + +["Byron/dua-cli"] + +["doy/rbw"] + +["twpayne/chezmoi"] + asset_filters = [ "glibc", ".tar.gz" ] + +["scop/bash-completion"] + # Needs manual intervention to install, as its a bash script with a subfolder containing completions + download_only = true + asset_filters = [ ".tar.xz" ] \ No newline at end of file