From e8ac82955e088523aca21cf7a5e1d3f071807748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petar=20Kapri=C5=A1?= Date: Wed, 23 Apr 2025 14:36:45 +0200 Subject: [PATCH] Enable use of categories for packages --- bs.sh | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 61 insertions(+), 5 deletions(-) diff --git a/bs.sh b/bs.sh index 4510f90..c617dbd 100644 --- a/bs.sh +++ b/bs.sh @@ -130,6 +130,43 @@ usercheck() { --yesno "The user \`$name\` already exists on this system. LARBS can install for a user already existing.\\n\\nLARBS will change $name's password to the one you just gave." 14 70 } +selectcategories() { + ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || + curl -Ls "$progsfile" | sed '/^#/d' >/tmp/progs.csv + selectedcats=$(whiptail --title "Select package categories" --separate-output \ + --checklist "Categories" 20 100 12 \ + "amd" "AMD specific packages" ON \ + "anki" "Anki" ON \ + "backup" "Packages for backing the system up (borg)" ON \ + "crypto" "Cryptocurrencies" ON \ + "cysec" "Packages i use for my work in Cybersecurity" ON \ + "dumb" "silly things I like to have" ON \ + "editing" "Audio/video editing" ON \ + "electronics" "Packages used for electronics and FPGA work" ON \ + "fonts" "Fonts" ON \ + "go" "Packages for work with golang" ON \ + "gui" "Packages needed for my GUI and dotfiles to work" ON \ + "haskell" "Haskell and things needed for it" ON \ + "latex" "LaTeX" ON \ + "lisp" "All sorts of Lisps" ON \ + "lowlev" "Packages for programming in low-level languages (C,C++,Rust,etc)" ON \ + "mail" "Mail client and related programs" ON \ + "matrix" "Matrix clients" ON \ + "ml" "Machine learning" ON \ + "office" "Office packages" ON \ + "passwords" "Password manager and related" ON \ + "python" "Packages for python programming" ON \ + "retro" "Retrocomputing" ON \ + "rss" "RSS" ON \ + "stats" "Statistics (R)" ON \ + "system" "Packages I expect on my system" ON \ + "tcl" "Tcl/Tk and related" ON \ + "torrent" "Torrent clients" ON \ + "virtual" "Virtual machine packages" ON \ + "webdev" "Web-development" ON \ + "www" "Browsers" ON 3>&1 1>&2 2>&3 3>&1) || exit 1 +} + preinstallmsg() { whiptail --title "Let's get this party started!" --yes-button "Let's go!" \ --no-button "No, nevermind!" \ @@ -193,15 +230,31 @@ manualinstall() { } maininstallations() { - ([ -f "$progsfile" ] && cp "$progsfile" /tmp/progs.csv) || - curl -Ls "$progsfile" | sed '/^#/d' >/tmp/progs.csv - total=$(wc -l /tmp/filtered-progs.csv + + awk -F "," '$1 ~ /^$/ { print $2 }'