🚀 add script to share expenses

This commit is contained in:
Moritz Böhme 2022-08-20 14:18:32 +02:00
parent aba421973d
commit 8eebd53841
Signed by: moritz
GPG key ID: 970C6E89EB0547A9

View file

@ -27,7 +27,20 @@ in
reg = "ledger reg -R -V --tail 15";
};
home-manager.users.moritz = {
home.packages = with pkgs; [ ledger ];
home.packages = with pkgs; let
reg-copy = writeShellApplication {
name = "reg-copy";
runtimeInputs = [ ledger xclip ];
text = ''
table="$(printf '%-10s %-30s %8s %8s\n' Datum Beschreibung Einzeln Gesamt && ledger reg -V --format '%10D %.30P %8t %8T\n' "$@")"
echo "$table"
echo "$table" | xclip -selection clipboard
'';
};
in
[ ledger reg-copy ];
xdg.configFile = {
"fish/completions/ledger.fish" = {
text = builtins.readFile ./ledger.fish;