- 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

40
shrc
View file

@ -1,4 +1,4 @@
#!/bin/echo Please run this program with: ". shrc" or include
#!/usr/bin/env -S echo Please run this program with: ". shrc" or include
# `FROM_RC=1 source shrc` in your RC file to set up an alias.
# Just opens your .rc file easily, for your current shell
@ -10,37 +10,9 @@ then
LD_INTERNAL=1 source $LD_SOURCE_FILE
fi
function md5_opt()
{
if [[ $daisy_has_md5sum -eq 1 ]];
then
echo $(md5sum "$1" | awk '{print $1}')
fi
}
shellname=$(basename $SHELL)
rc_name="."$shellname"rc"
rc_path="$HOME/$rc_name"
if [[ $FROM_RC -eq 1 ]]; then
alias shrc=". shrc"
else
shellname=$(basename $SHELL)
rc_name="."$shellname"rc"
rc_path="$HOME/$rc_name"
# Optional MD5 checks
has_changed=1
sum1=$(md5_opt "$rc_path")
# This sets a default if the variable does not exist.
EDITOR=${EDITOR:-$(ched)}
$EDITOR "$rc_path"
wait_for_editor $EDITOR "$rc_path"
sum2=$(md5_opt "$rc_path")
if [[ $daisy_has_md5sum -eq 1 && "$sum1" == "$sum2" ]];
then
echo "The RC-file $rc_name has not changed on disk. Not sourcing."
return
fi
source "$rc_path"
fi
daisy_editor "$rc_path"
source "$rc_path"