Here are some utility scripts I wrote for myself. At first I wrote the scripts in a shell scripting language. But then I discovered Babashka and I love Clojure. I decided to port all the scripts to Clojure instead. You will need Babashka to run these scripts. These are helper tools for Clj, Ledger and Taskwarrior.
Scripts included:
- cljminimal - creates an ultra barebones deps.edn clj project for quick hacking
- keepbooks - simple transaction entry helper for Ledger CLI accounting
- startnewtask - creates and starts a new Taskwarrior task
- stoptasks - stops all active Taskwarrior tasks
You need to first install Babashka.
git clone https://github.com/somecho/utility-scripts
cd utility-scripts
./install.clj
This will copy all the scripts into ~/.local/bin
. Make sure ~/.local/bin
is in your path to call the scripts globally.
To uninstall, simply call uninstall-some-scripts
and all the scripts will be deleted from ~/.local/bin
.
A script to create an ultraminimal clj project with an empty deps.edn and a singular hello world main function. To use, simply call cljminimal my-minimal-clj-project
and a project called my-minimal-clj-project
will be created for you. Mainly used for quick hacking and throwaway prototyping.
A helper script to enter a simple transaction into a Ledger file. The script has the following format:
keepbooks -f LEDGERFILE -d DATE PAYEE? ACCOUNT_TO_DEBIT ACCOUNT_TO_CREDIT AMOUNT CURRENCY
The -d DATE
field is optional. If this flag is ommitted, the current date will be used. The PAYEE
field is also optional. If the PAYEE
is ommitted, no payee will be entered in the transaction. The other fields ACCOUNT_TO_DEBIT
, ACCOUNT_TO_CREDIT
, AMOUNT
and CURRENCY
are required fields. The ordering is strict. Upon entering a successful command, the ledger entry will be written into the ledger file provided and also printed out in the commandline.
keepbooks -f 2023.ledger -d 2023/07/20 Sushi Bar Expenses:Restaurant Assets:Bank 30.00 EUR
# prints out:
# 2023/07/20 Sushi Bar
# Expenses:Restaurant 30.00 EUR
# Assets:Bank
Creates and immediately starts a Taskwarrior task. Use this as you would task add
.
task add +admin +bookkeeping track finance # adds a task to Taskwarrior
startnewtask +admin +bookkeeping track finance # adds and starts task
Stops all active Taskwarrior tasks. Every tried task stop
and gotten an error? Yeah, me too. Now you can stop all active tasks with a single stoptasks
.
- 584d3d0 - added create-clj-minimal shell script
- 4b8c492 - added stoptasks shell script
- 41de9d4 - added starttasks shell script
- 8bd623e - ported create-clj-minimal to Clojure. It is now called cljminimal
- 3a57c9a - ported starttasks to Clojure. It is now called startnewtask
- e610b0b - ported stoptasks to Clojure.
- 80e3f79 - added install script
- 2ec63e7 - added uninstall script
- f1d42f7 - removed the uninstall script in favor of a programmatically created uninstall script. Installing these scripts now automatically creates
uninstall-some-scripts
. - a020b2a - added keepbooks
- 2d46c23 - fix #1