From 767049dda47605b904b49836f281672b7899ca78 Mon Sep 17 00:00:00 2001
From: joe
Date: Mon, 6 Oct 2025 22:23:57 +0200
Subject: up
---
.local/bin/idea | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
(limited to '.local/bin/idea')
diff --git a/.local/bin/idea b/.local/bin/idea
index c3fc9b4..e4207b7 100755
--- a/.local/bin/idea
+++ b/.local/bin/idea
@@ -1,22 +1,27 @@
#!/bin/sh -e
-if [ -z "$1" ]; then
+title="untitled"
+
+if [ -z "$2" ]; then
thought=$(cat -)
-elif [ -f "$1" ]; then
- thought=$(cat "$1")
+ title="$1"
+elif [ -f "$2" ]; then
+ thought=$(cat "$2")
+ title="$1"
else
- thought="$*"
+ thought="${*:2}"
+ title="$1"
fi
thought="$(printf "%s" "${thought}" | sed '{s#^#\\t\\t\\t\\t\\t#;s#^\\t\\t\\t\\t\\t$#\\t\\t\\t\\t
\\\n\\t\\t\\t\\t#;s#$#\\#;}')"
date=$(date '+%a, %d %b %Y %H:%M')
-html_fmt='\t\t\t\t
'"${date}"'
\
+html_fmt='\t\t\t\t'"${date}"' - '"${title}"'
\
\t\t\t\t\
'"${thought}"'
\t\t\t\t
\
'
rss_fmt='\\t- \
-\t '"${date}"'\
+\t '"${title}"'\
\t '"${date} $(date '+%Z')"'\
\t http://jozan.org/thoughts.html\
\t '"$(uuidgen)"'\
--
cgit v1.2.3