- Minor cleanup

- Change shebangs to use 'env' in prep for NixOS (and others)
- `agenda` now has a symlink to the underlying tree structure named ".tree"
- `binbox` has more checking, being prepped for automatic export of symlinks.
- `cdz` now symlinks to the archive directory using "<archive name>.tmp". This is less confusing than a randomized extraction folder, and adds the benefit of being in the FS-tree of the original archive.
- daisy.source changes:
> Added basic debug mode.
> `ched` can now set global (all of the shell) editor or local (lackadaisical utils only) editor.
> The encoding/decoding functions have been expanded and improved. Extra checking, permissions are stored as well, `daisy_dec` can handle stdin.
- Added new functions to manage lackadaisical config: daisy_backup (runs `bak` on config files), daisy_clear (removes config files), and daisy_restore (restores config files archived using bak).
- All functions/tools prefixed with 'daisy_' are now also available prefixed with 'ld_' instead
- Added a new utility, `clip`. This utility keeps a local variable that can be set if given args and get if no args are supplied. Basically a simple clipboard local to the ptty. Supports stdin.
This commit is contained in:
Sam Hardeman 2026-01-25 18:23:05 +01:00
parent 021e4d3b44
commit 160a7763b7
13 changed files with 480 additions and 269 deletions

22
cdz
View file

@ -1,8 +1,8 @@
#!/bin/bash
#!/usr/bin/env bash
if [[ $LD_INTERNAL -ne 1 ]];
then
export LD_INTERNAL=1
LD_INTERNAL=1
. $(dirname $(realpath $0))/daisy.source
fi
@ -28,6 +28,7 @@ hasmounter=$?
file "$target" 1>/dev/null
exitcode=$?
report=$(file "$target")
name=$(echo $@ | sed 's/:.*//' | sed 's|.*/||')
# Check for archive type, supported types are zip/tar/rar
comm1=(:)
@ -88,7 +89,7 @@ elif (( $israr == 0 )); then
comm3=(exit 1)
fi
elif (( $hasmounter == 0 )); then
comm2=(archivemount "$target")
comm2=(archivemount -o allow_root -o use_ino "$target")
comm4=(cd ..)
comm5=(umount)
fi
@ -101,18 +102,17 @@ dir=$(mktemp -d /tmp/extracted.XXXXXXXX)
"${comm2[@]}" $dir
"${comm3[@]}"
currentpath=$(realpath .)
cd $dir
currentpath=$(pwd)
sym="$currentpath/$name.tmp"
ln -f -s "$dir" "$sym"
cd "$sym"
# With archivemount, making a symlink will alter the archive
if (( $hasmounter == 1 )); then
ln -s $currentpath ./link-back
echo "A symlink to your original path has been created under the name \`link-back\`."
echo "You can use this to copy out files, but you can also just access your filesystem regularly."
fi
echo "A symlink has been made under the name \"$sym\"."
echo "This symlink points to the data directory \"$dir\"."
echo "Type 'exit' to exit the extracted archive's folder and auto-delete it."
eval $SHELL
"${comm4[@]}"
"${comm5[@]}" $dir
rm -rf $dir
rm "$sym"