summaryrefslogtreecommitdiff
path: root/sys/orgdenv
diff options
context:
space:
mode:
authorGeorge Abbott <george@gabbott.dev>2023-10-31 17:54:07 +0000
committerGeorge Abbott <george@gabbott.dev>2023-10-31 17:54:07 +0000
commit4d0bd914e7c1ee65f4036e60149a7b891906a5d3 (patch)
treec2a6751823e064e003cd4f6166df07bfc106d7eb /sys/orgdenv
Commit all to date.
Diffstat (limited to 'sys/orgdenv')
-rwxr-xr-xsys/orgdenv27
1 files changed, 27 insertions, 0 deletions
diff --git a/sys/orgdenv b/sys/orgdenv
new file mode 100755
index 0000000..9c537eb
--- /dev/null
+++ b/sys/orgdenv
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+# Set up the full gamut of ORGD environment variables based on the prompt
+# path.
+
+# Usage:
+# orgdenv .profile
+# Add all default orgd paths, e.g. $HOME/docs/wr/orgd into .profile.
+# orgdenv .zshrc ~/.local/orgd
+# Add orgd paths starting at ~/.local/orgd into .zshrc.
+# TODO: finish the envvars off.
+
+[ -z "$1" ] && echo "You must provide a file to add into." && exit
+[ -z "$2" ] && ORGD_ROOT="$HOME/docs/wr/orgd" || ORGD_ROOT="$2"
+
+echo "$1"
+echo "$2"
+touch "$1"
+
+cat > "$1" <<-END
+ export ORGD_ROOT="$ORGD_ROOT"
+ # kt
+ export ORGD_KT_PATH="$ORGD_ROOT/kt"
+ export ORGD_BIB_PATH="$ORGD_KT_PATH/biblio"
+ export ORGD_BIBCSV_PATH="$ORGD_KT_PATH/biblio.csv"
+ export ORGD_MED_PATH="$ORGD_ROOT/med"
+END