From c6dd88d5098e7ee13db9220e2225e578c1ff1423 Mon Sep 17 00:00:00 2001 From: cswimr Date: Thu, 14 Nov 2024 16:24:28 -0500 Subject: [PATCH] use `bat` inside of `pacsize` --- .config/bat/syntaxes/packages.sublime-syntax | 15 +++++++++++++++ .gitignore | 3 +++ .zshc/aliases.zsh | 11 ++++++----- 3 files changed, 24 insertions(+), 5 deletions(-) create mode 100644 .config/bat/syntaxes/packages.sublime-syntax diff --git a/.config/bat/syntaxes/packages.sublime-syntax b/.config/bat/syntaxes/packages.sublime-syntax new file mode 100644 index 0000000..e926b89 --- /dev/null +++ b/.config/bat/syntaxes/packages.sublime-syntax @@ -0,0 +1,15 @@ +%YAML 1.2 +--- +name: Packages +file_extensions: [pkglist] +scope: source.packages +contexts: + main: + # Match package names (assuming they are words with letters, numbers, hyphens, and underscores) + - match: \b[a-z][a-z0-9\-_\.]+\b + scope: keyword + + # Match file sizes with different units (KiB, MiB, GiB, TiB, etc.) + - match: \d+(\.\d+)?\s+(KiB|MiB|GiB|TiB) + scope: constant.numeric + diff --git a/.gitignore b/.gitignore index f33b664..ec5793f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,9 @@ !.config/glow/ !.config/glow/** +!.config/bat/ +!.config/bat/** + !.config/btop/ !.config/btop/** .config/btop/** diff --git a/.zshc/aliases.zsh b/.zshc/aliases.zsh index dd19451..9880b42 100755 --- a/.zshc/aliases.zsh +++ b/.zshc/aliases.zsh @@ -19,11 +19,6 @@ alias vi="${EDITOR}" alias vim="${EDITOR}" alias nano="${EDITOR}" -if (( $+commands[pacman] )); then - # this lists packages installed with pacman by size in mebibytes - alias pacsize="pacman -Qi | egrep '^(Name|Installed)' | cut -f2 -d':' | paste - - | column -t | sort -nrk 2 | grep MiB | less" -fi - if (( $+commands[yay] )); then alias aur="yay" alias yaystats="yay -P --stats" @@ -54,6 +49,11 @@ if (( $+commands[lazydocker] )); then alias lad="lazydocker" fi +if (( $+commands[pacman] )); then + # this lists packages installed with pacman by size in mebibytes + alias pacsize="pacman -Qi | egrep '^(Name|Installed)' | cut -f2 -d':' | paste - - | column -t | sort -nrk 2 | grep MiB | cat --language=packages --style numbers,grid" +fi + if (( $+commands[nvidia-smi] )); then alias driver="nvidia-smi" fi @@ -66,6 +66,7 @@ fi if (( $+commands[tailscale] )); then alias taildrop="tailscale file" fi + alias protontricks="flatpak run com.github.Matoking.protontricks" alias sober="flatpak run org.vinegarhq.Sober" alias c="clear"