From 53ca8cf510a123ed8b3eef3bbe847f9f1b40793b Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 15 May 2021 14:46:57 +0200 Subject: Add ledger report script for plotting w/ gnuplot --- ledgerrc.org | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/ledgerrc.org b/ledgerrc.org index ec44d5e..34bedd6 100644 --- a/ledgerrc.org +++ b/ledgerrc.org @@ -1,8 +1,32 @@ #+PROPERTY: header-args:conf :tangle tangle/.ledgerrc :results silent #+begin_src conf ---file ~/.personal/f/ledger/main.ledger +--file ~/git/projects/ledger/main.ledger #+end_src -#+begin_src shell :tangle tangle/symlink.sh :shebang "#!/bin/bash" +#+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 <