summaryrefslogtreecommitdiff
path: root/ledgerrc.org
blob: 34bedd6092f61b430f319781c75a06004680f65a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent

#+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"
# 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