🚀 add script to share expenses

nixos
Moritz Böhme 2022-08-20 14:18:32 +02:00
parent aba421973d
commit 8eebd53841
Signed by: moritz
GPG Key ID: 970C6E89EB0547A9
1 changed files with 14 additions and 1 deletions

View File

@ -27,7 +27,20 @@ in
reg = "ledger reg -R -V --tail 15"; reg = "ledger reg -R -V --tail 15";
}; };
home-manager.users.moritz = { 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 = { xdg.configFile = {
"fish/completions/ledger.fish" = { "fish/completions/ledger.fish" = {
text = builtins.readFile ./ledger.fish; text = builtins.readFile ./ledger.fish;