aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-09-18 16:36:58 -0300
committerSilvio Rhatto <user@example.org>2014-09-18 16:36:58 -0300
commit53e6f6a7836a0a098c78ac35af755eef68e5aada (patch)
tree1d043602e634644b7c18a5d37b57337813b95922
downloadtimelog-53e6f6a7836a0a098c78ac35af755eef68e5aada.tar.gz
timelog-53e6f6a7836a0a098c78ac35af755eef68e5aada.tar.bz2
Initial import
-rw-r--r--README.md0
-rw-r--r--TODO.md0
-rwxr-xr-xtimelog49
3 files changed, 49 insertions, 0 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/README.md
diff --git a/TODO.md b/TODO.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TODO.md
diff --git a/timelog b/timelog
new file mode 100755
index 0000000..289c298
--- /dev/null
+++ b/timelog
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# Worklog wrapper
+#
+# Alternatives to current worklog backend:
+#
+# https://github.com/snaptortoise/worklog
+# https://github.com/tormaroe/worklog
+# https://github.com/winged/worklog
+
+BASE="$HOME/file"
+CODEBASE="$HOME/code"
+GROUP="$1"
+ACTION="$2"
+BASENAME="`basename $0`"
+
+if [ -z "$GROUP" ]; then
+ echo "Usage: $BASENAME <group> [edit]"
+ exit 1
+fi
+
+if [ -z "$EDITOR" ]; then
+ EDITOR="vi"
+fi
+
+if [ -d "$CODEBASE/$GROUP" ] && [ ! -d "$BASE/$GROUP" ]; then
+ BASE="$CODEBASE"
+fi
+
+mkdir -p $BASE/$GROUP/worklog
+
+if [ ! -e "$BASE/$GROUP/worklog/projects" ]; then
+ cat > $BASE/$GROUP/worklog/projects <<EOF
+# Worklog project file
+# note that projects appear in Worklog in REVERSE order
+
+#H:Hosting
+#I:Infrastructure
+#O:Organization
+EOF
+
+ echo "First run, you should edit your project list..."
+ $EDITOR $BASE/$GROUP/worklog/projects
+ ( cd $BASE/$GROUP/worklog && worklog )
+elif [ "$ACTION" == "edit" ]; then
+ $EDITOR $BASE/$GROUP/worklog/projects
+else
+ ( cd $BASE/$GROUP/worklog && worklog )
+fi