summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Juan Loeza Sierra <jj@xz6ze.com>2025-10-10 14:04:54 -0700
committerJosé Juan Loeza Sierra <jj@xz6ze.com>2025-10-10 14:04:54 -0700
commit5ba4d843f8912a76597284660f5185fd42f7aa34 (patch)
tree205cd78508924a9093d9bb851dfd5c34e635cf7d
parent668bbc1c3461a8dcadd2c93cc22741c1eb89abe6 (diff)
add alias to search for pacman packages
-rw-r--r--dot-bashrc4
1 files changed, 4 insertions, 0 deletions
diff --git a/dot-bashrc b/dot-bashrc
index 583b883..1511798 100644
--- a/dot-bashrc
+++ b/dot-bashrc
@@ -56,6 +56,10 @@ export RCLONE_CHECKERS=200
# list packages installed explicitly, sorted by date
alias pacbd="cd && pacman -Qqe > pkglist.txt && expac --timefmt='%Y-%m-%d %T' '%l\t%n' | sort | sed 's/^.*\s//' - | rg -f pkglist.txt -x"
+# Query packages with fzf
+# adapted from: https://www.reddit.com/r/archlinux/comments/xyjolo/using_fzf_to_search_pacman_database_including/
+alias packages="pacman -Ss | paste -d '' - - | sed -e 's|/|\t|' | fzf --multi --preview 'pacman -Siiv {2}' --tiebreak begin -e | rg '\t([^\s]+)' -o --trim | xargs -ro sudo pacman -S"
+
# distrobox dev environment
alias dev="distrobox enter dev"