From 45fbd573020e593a7bd7fd81c735d5e20dd656ab Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Sat, 16 Mar 2024 18:51:56 +0300 Subject: [PATCH] [a] Add package preview --- README.md | 8 ++++---- a | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 3a6a356..fdfedb2 100644 --- a/README.md +++ b/README.md @@ -3,10 +3,10 @@ GUI scripts for popular cli tools, based on dialog and fzf ## Scripts -a - for managing apt packages -g - for managing git repo -s - for managing systemd services -r - for running named commands from ~/.aliases.txt file +- `a` - for managing apt packages +- `g` - for managing git repo +- `s` - for managing systemd services +- `r` - for running named commands from ~/.aliases.txt file ## Installation Download .deb package from Releases, then install it diff --git a/a b/a index 7be0f47..a7b041b 100755 --- a/a +++ b/a @@ -8,7 +8,7 @@ action=$(DIALOGRC=/tmp/.dialogrc dialog --stdout --erase-on-exit --menu "Choose if [[ $action == "Install" || $action == "Remove" ]]; then - package=$(apt list 2>/dev/null | awk -F'/' 'NR>1{print $1}' | fzf) + package=$(apt-cache search '' | sort | cut --delimiter ' ' --fields 1 | fzf --multi --cycle --reverse --preview 'apt-cache show {1}') sudo apt ${action,,} $package -y elif [[ $action == "Update" || $action == "Upgrade" ]]; then sudo apt ${action,,} -y