summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYigit Sever2020-11-08 23:19:18 +0300
committerYigit Sever2020-11-08 23:19:18 +0300
commit39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2 (patch)
tree3645d39a288dc8bf7d532845ea7c2890773ca20f
parent3344f3b1b3d46329eee77ebc993ef19aa7f3ff74 (diff)
downloaddotfiles-39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2.tar.gz
dotfiles-39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2.tar.bz2
dotfiles-39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2.zip
tracking ledger rot function
-rw-r--r--.zshrc12
1 files changed, 12 insertions, 0 deletions
diff --git a/.zshrc b/.zshrc
index 689539e..1256f2a 100644
--- a/.zshrc
+++ b/.zshrc
@@ -190,3 +190,15 @@ fi
190 190
191export WECHALLUSER="drocan" 191export WECHALLUSER="drocan"
192export WECHALLTOKEN="35624-0D38B-A2F16-A98B0-5963D-6DF19" 192export WECHALLTOKEN="35624-0D38B-A2F16-A98B0-5963D-6DF19"
193
194ledgerrot() {
195 day=$(tail -n4 ~/nextcloud/ledger.ledger | grep -Eo '[0-9]{4}-[0-9]{2}-[0-9]{2}')
196 d1=$(date -d "now" +%s)
197 d2=$(date -d "$day" +%s)
198 days=$(( (d1 - d2) / 86400 ))
199 if [ "$days" -eq "0" ]; then
200 echo "you good";
201 else
202 echo "$days days";
203 fi
204}