Skip to content

A collection of helper scripts for Clojure, Java, Ledger and Taskwarrior. Written in Clojure.

License

Notifications You must be signed in to change notification settings

somecho/utility-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Somē's utility scripts

Here are some utility scripts I wrote for myself. At first I wanted to write 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.

Installation

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.

Uninstalling

To uninstall, simply call uninstall-some-scripts and all the scripts will be deleted from ~/.local/bin.

Scripts

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 transaction into a Ledger file. The script has the following format:

keepbooks -f LEDGERFILE DATE PAYEE ACCOUNT_TO_DEBIT ACCOUNT_TO_CREDIT AMOUNT CURRENCY

You can ommit the DATE field. You can also ommit both DATE and PAYEE fields, but you cannot ommit the PAYEE field and not the DATE field. Valid commands:

keepbooks -f LEDGERFILE DATE PAYEE ACCOUNT_TO_DEBIT ACCOUNT_TO_CREDIT AMOUNT CURRENCY
keepbooks -f LEDGERFILE PAYEE ACCOUNT_TO_DEBIT ACCOUNT_TO_CREDIT AMOUNT CURRENCY # date ommitted
keepbooks -f LEDGERFILE ACCOUNT_TO_DEBIT ACCOUNT_TO_CREDIT AMOUNT CURRENCY # date AND payee ommitted

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 2023/07/20 Sushi Expenses:Restaurant Assets:Bank 30.00 EUR
# prints out:
# 2023/07/20 Sushi
#  Expenses:Restaurant                       30.00 EUR
#  Assets:Bank

At the moment, the payee field cannot contain spaces #1.

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.

Change log

About

A collection of helper scripts for Clojure, Java, Ledger and Taskwarrior. Written in Clojure.

Topics

Resources

License

Stars

Watchers

Forks