summaryrefslogtreecommitdiff
path: root/ledgerrc.org
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--ledgerrc.org32
1 files changed, 32 insertions, 0 deletions
diff --git a/ledgerrc.org b/ledgerrc.org
new file mode 100644
index 0000000..78b9f31
--- /dev/null
+++ b/ledgerrc.org
@@ -0,0 +1,32 @@
+#+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent :tangle-mode (identity #o444)
+
+#+begin_src conf
+--file ~/git/projects/ledger/main.ledger
+#+end_src
+#+begin_src shell :tangle tangle/symlink.sh :shebang "#!/bin/bash" :results silent
+ln -siv $(pwd)/tangle/.ledgerrc ~/
+ln -siv $(pwd)/tangle/report ~/.local/bin/
+#+end_src
+
+The =report= script can be used for simple plotting of ledger output using gnuplot. This is taken directly from the ledger git repo.
+#+begin_src shell :tangle tangle/report :shebang "#!/usr/bin/env sh" :tangle-mode (identity #o555)
+# This script facilities plotting of a ledger register report. If you
+# use OS/X, and have AquaTerm installed, you will probably want to set
+# LEDGER_TERM to "aqua".
+#
+# Examples of use:
+#
+# report -j -M reg food # plot monthly food costs
+# report -J reg checking # plot checking account balance
+
+if [ -z "$LEDGER_TERM" ]; then
+ LEDGER_TERM="wxt persist"
+fi
+
+(cat <<EOF; ledger "$@") | gnuplot
+ set terminal $LEDGER_TERM
+ set xdata time
+ set timefmt "%Y-%m-%d"
+ plot "-" using 1:2 with linespoints
+EOF
+#+end_src