diff options
author | Yigit Sever | 2020-11-08 23:19:18 +0300 |
---|---|---|
committer | Yigit Sever | 2020-11-08 23:19:18 +0300 |
commit | 39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2 (patch) | |
tree | 3645d39a288dc8bf7d532845ea7c2890773ca20f | |
parent | 3344f3b1b3d46329eee77ebc993ef19aa7f3ff74 (diff) | |
download | dotfiles-39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2.tar.gz dotfiles-39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2.tar.bz2 dotfiles-39df01fc3c48a4f4ffb3ed0c47c7f58e5597aaa2.zip |
tracking ledger rot function
-rw-r--r-- | .zshrc | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -190,3 +190,15 @@ fi | |||
190 | 190 | ||
191 | export WECHALLUSER="drocan" | 191 | export WECHALLUSER="drocan" |
192 | export WECHALLTOKEN="35624-0D38B-A2F16-A98B0-5963D-6DF19" | 192 | export WECHALLTOKEN="35624-0D38B-A2F16-A98B0-5963D-6DF19" |
193 | |||
194 | ledgerrot() { | ||
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 | } | ||