Added archive for up to date note transfer, will need to replicate this on other machines, perhaps encryption or a password would be cool

This commit is contained in:
Michal Skorczak 2025-02-05 17:25:29 +00:00
parent e1bad7d4f2
commit 7567955724
5 changed files with 1066 additions and 35 deletions

1024
Bloody.flf Executable file

File diff suppressed because it is too large Load diff

BIN
ProggyClean.ttf Executable file

Binary file not shown.

View file

@ -1,5 +1,6 @@
# dev-env # dev-env
## requirements ## requirements
`$TODOTXTPATH` needs to be set to your todo.txt path. `$TODOTXTPATH` needs to be set to your todo.txt path.

BIN
archive.tar.gz Normal file

Binary file not shown.

View file

@ -1,4 +1,9 @@
#!/bin/bash #!/bin/sh
_print_title()
{
echo "$(figlet mskor dev-env)"
}
_notes_locations_print() _notes_locations_print()
{ {
@ -10,7 +15,8 @@ _notes_locations_print()
_help() _help()
{ {
echo "dev-env.sh usage: $0 [mode]" _print_title
echo "setup-dev-env.sh usage: $0 [mode]"
echo "\txn: Extract notes to:" echo "\txn: Extract notes to:"
_notes_locations_print _notes_locations_print
echo "\tsn: Store notes:" echo "\tsn: Store notes:"
@ -50,40 +56,40 @@ _storage_notes()
exit 0 exit 0
} }
_reverse(){ reversed=();local i;for ((i=$#;i>0;i--)); do reversed+=("${!i}");done; } #_reverse(){ reversed=();local i;for ((i=$#;i>0;i--)); do reversed+=("${!i}");done; }
#
_graph_notes() #_graph_notes()
{ #{
# i want this function to show me a graph of work created to work done # # i want this function to show me a graph of work created to work done
readarray -t arr < $TODOTXTPATH # readarray -t arr < $TODOTXTPATH
for value in "${arr[@]}"; do # for value in "${arr[@]}"; do
mapfile -t dates < <(echo $value | grep -Po '(?<!:)[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}') &>/dev/null # #mapfile -t dates < <(echo $value | grep -Po '(?<!:)[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}') &>/dev/null
declare dates # declare dates
declare -A datemap # declare -A datemap
declare -A compdatemap # declare -A compdatemap
_reverse "${dates[@]}" && for i in "${reversed[@]}"; do # _reverse "${dates[@]}" && for i in "${reversed[@]}"; do
## if there are 2 options then do the following ## if there are 2 options then do the following
## if there is one option then do the following ## if there is one option then do the following
if [[ -z "${datemap["$i"]}" ]]; then # if [[ -z "${datemap["$i"]}" ]]; then
datemap[$i]=1 # datemap[$i]=1
else # else
datemap[$i]="$((datemap[$i] + 1))" # datemap[$i]="$((datemap[$i] + 1))"
fi # fi
# if one value, add 1 to that index on map # # if one value, add 1 to that index on map
# if 2 values, add 1 to index of map and # # if 2 values, add 1 to index of map and
done # done
if [[ ${#reversed[@]} == 2 ]]; then # if [[ ${#reversed[@]} == 2 ]]; then
echo "$datemap[$i]" # echo "$datemap[$i]"
echo "COMPLETED ITEM" # echo "COMPLETED ITEM"
fi # fi
#
# got the dates here, arrays of 2 mean the task was completed and should be added as [date1] [created] [date2] completed # # got the dates here, arrays of 2 mean the task was completed and should be added as [date1] [created] [date2] completed
done # done
for key in ${!datemap[@]} # for key in ${!datemap[@]}
do # do
echo "${key}, ${datemap[${key}]}" # echo "${key}, ${datemap[${key}]}"
done # done
} #}
_launch_notes() _launch_notes()
{ {
@ -126,7 +132,7 @@ case "$1" in
sn ) _storage_notes ;; sn ) _storage_notes ;;
xn ) _extract_notes ;; xn ) _extract_notes ;;
notes ) _launch_notes ;; notes ) _launch_notes ;;
graph ) _graph_notes ;; #graph ) _graph_notes ;;
* ) _help ;; * ) _help ;;
esac esac