summaryrefslogtreecommitdiff
path: root/s
diff options
context:
space:
mode:
authorluxagraf <sng@luxagraf.net>2023-06-15 15:58:59 -0500
committerluxagraf <sng@luxagraf.net>2023-06-15 15:58:59 -0500
commitab987e10f154f5536bb8fd936ae0966e909fa969 (patch)
tree9de5076f38b71ececb1bc94f8d9d19170898d603 /s
added all my scriptssynced/master
Diffstat (limited to 's')
-rwxr-xr-xs15
1 files changed, 15 insertions, 0 deletions
diff --git a/s b/s
new file mode 100755
index 0000000..30b8ef4
--- /dev/null
+++ b/s
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -e
+
+readonly NOTES_DIRECTORY="${NOTES_DIRECTORY:-"${HOME}/notes"}"
+readonly NOTES_PATH="${NOTES_DIRECTORY}/@someday.txt"
+
+if [ ${#} -eq 0 ]; then
+ if [ -p "/dev/stdin" ]; then
+ (cat; printf "\n\n") >> "${NOTES_PATH}"
+ else
+ eval "${EDITOR} '+normal G$' +startinsert " "${NOTES_PATH}"
+ fi
+else
+ printf "%s\n" "${*}" >> "${NOTES_PATH}"
+fi