feat: restructure groups

This commit is contained in:
xeruf 2022-12-16 19:30:26 +01:00
parent dba97ec3c6
commit 990e393dd3
11 changed files with 44 additions and 12 deletions

View File

@ -195,6 +195,18 @@ but the details still need to be fleshed out.
- Use system subdirectories for handlers and groups,
which are used by default when system is detected
## Notes on this Repository
### Groups
- shell/basics: without these a linux machine is hardly usable
- shell/tools: without these, a linux computer is not productively usable for me
- shell/enhancements: replacements for commonly used, dated tools, such as `ls`->`exa` and `top`->`glances`
### Handlers
## Notable Projects
- another universal package manager,

View File

@ -12,3 +12,4 @@ composing
refind
refind-theme-maia
bluetooth
openvpn

View File

@ -16,3 +16,4 @@ emacs-pdf-tools-git
dex
inotify-tools
entr
dragon-drop

View File

@ -3,3 +3,4 @@ jdk/8
notion
docker
docker-compose
phantomjs-bin

4
groups/shell/all Normal file
View File

@ -0,0 +1,4 @@
shell/tools
shell/enhancements
shell/preview
shell/power

View File

@ -0,0 +1,2 @@
exa
glances

4
groups/shell/power Normal file
View File

@ -0,0 +1,4 @@
youtube-dl
ffmpeg
imagemagick
pandoc

3
groups/shell/preview Normal file
View File

@ -0,0 +1,3 @@
audiowaveform
mtn
rdictcc-git

View File

@ -9,8 +9,8 @@ locate
diffr
tldr
kitty
timg
exa
strace
timg
tmux
glances
jq
dd

View File

@ -2,3 +2,4 @@ dev/tools
shell/tools
passwords
forensics
openvpn

View File

@ -12,17 +12,19 @@ destress() { echo "$1" >&2; }
# Get the content of a file or the output of its execution
getcontent() {
if test -z "$noexec" && test -x "$1"
then "$1"
else cat "$1"
fi
for arg; do
if test -z "$noexec" && test -x "$arg"
then "$arg"
else cat "$arg"
fi
done
}
# Get available package entries for given package
getentries() {
cat "$handlersfile" | while read handler
do find "$dir_packages/$1/" -depth -type f -name "$handler*" 2>/dev/null | tac
done
do find "$dir_packages/$1/" -depth -type f -name "$handler*" 2>/dev/null | tac
done
}
# Install a package by name
@ -142,9 +144,10 @@ installdefault() {
}
runinstalee() {
local groupfile="$dir_home/groups/$1"
if test -f "$groupfile"
then for package in $(getcontent "$groupfile")
local groupfiles=$(find "$dir_home/groups/$1" -type f 2>/dev/null)
if test -n "$groupfiles"
then
for package in $(getcontent $groupfiles)
do runinstalee "$package" || installdefault "$package"
done
else installpkg "$1" || { test "$default" && installdefault "$1"; }