diff options
-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 | } | ||