kalbhor / thirsty

Reminds you to drink water - on your terminal.
MIT License
316 stars 17 forks source link

You can reduce down to 1 file with modification times #2

Closed jedahan closed 7 years ago

jedahan commented 7 years ago

zsh's ls supports modifiers, for example, to only show things modified X seconds ago:

\ls $HOME/.water(ms+60) || echo "its been over 60 seconds since ya drank something"

The backslash is to make sure no weird aliases are interpreted.

If you decide to use modification time, then you don't even need to echo anything to the file, and can

function not_thirsty { touch ${HOME}/.water; }
kalbhor commented 7 years ago

This makes sense, my knowledge on bash and zsh is limited. Would you like to send a pull request? Please make sure that changes work for both bash and zsh.

kalbhor commented 7 years ago

Completed in #4