Mercurial > index.cgi > dotfiles
comparison .bash_profile @ 33:f59f847377d7
* Added toodledo interfacing
* Moved some logic from .bash_profile to .bash_aliases for exporting to
subshells
* Disowned backgrounded processes
| author | huston@80426f53-59d1-405d-934b-f07cd76f4a1a |
|---|---|
| date | Fri, 05 Mar 2010 19:07:47 +0000 |
| parents | ca6c77fe843b |
| children | d59d16a55494 |
comparison
equal
deleted
inserted
replaced
| 32:29dfb30b069c | 33:f59f847377d7 |
|---|---|
| 30 # (though it could be edited fairly easily for any other version control | 30 # (though it could be edited fairly easily for any other version control |
| 31 # system I'm sure). We check the timestamp of the file '$HOME/.dotfilets'. | 31 # system I'm sure). We check the timestamp of the file '$HOME/.dotfilets'. |
| 32 # If it's older than a month, run a 'svn st -u' and touch it; this way we | 32 # If it's older than a month, run a 'svn st -u' and touch it; this way we |
| 33 # check once per month to see if we forgot to pull down an updated version. | 33 # check once per month to see if we forgot to pull down an updated version. |
| 34 | 34 |
| 35 # First set $STAT and $DATE since the syntax of the commands is different | |
| 36 # between Linux and Mac OS X. If this is run elsewhere, the eval will be | |
| 37 # false and the test not done below, so it's safe to not bother checking for | |
| 38 # zero-length variables on the test - it just won't run the svn status, so you | |
| 39 # won't be prompted if there's newer files available in your repository. | |
| 40 | |
| 41 case `uname` in | |
| 42 Darwin) | |
| 43 DFSTAT="stat -f %m -t %s $HOME/.dotfilets" | |
| 44 MDATE="date -v -1m +%s" | |
| 45 TDSTAT="stat -f %m -t %s $HOME/.todo" | |
| 46 HDATE="date -v -1h +%s" | |
| 47 ;; | |
| 48 | |
| 49 Linux) | |
| 50 DFSTAT="stat -c %Y $HOME/.dotfilets" | |
| 51 MDATE="date -d \"1 month ago\" +%s" | |
| 52 TDSTAT="stat -c %Y $HOME/.todo" | |
| 53 HDATE="date -d \"1 hour ago\" +%s" | |
| 54 ;; | |
| 55 esac | |
| 56 | |
| 57 [[ ! -f $HOME/.dotfilets || \ | 35 [[ ! -f $HOME/.dotfilets || \ |
| 58 `eval $DFSTAT` -lt `eval $MDATE` ]] && { | 36 `eval $DFSTAT` -lt `eval $MDATE` ]] && { |
| 59 echo -n Dotfiles last checked over a month ago | 37 echo -n Dotfiles last checked over a month ago |
| 60 | 38 |
| 61 # Here we switch for hosts we don't want to check, just warn | 39 # Here we switch for hosts we don't want to check, just warn |
| 66 ;; | 44 ;; |
| 67 | 45 |
| 68 *) | 46 *) |
| 69 echo , running a status test. | 47 echo , running a status test. |
| 70 svn st -u && touch $HOME/.dotfilets & | 48 svn st -u && touch $HOME/.dotfilets & |
| 49 disown %+ | |
| 71 esac | 50 esac |
| 72 } | 51 } |
| 73 | |
| 74 # Work in progress - toodledo to ~/.todo | |
| 75 #[[ -f $HOME/.todo ]] && cat $HOME/.todo | |
| 76 # | |
| 77 #case `hostname -s` in | |
| 78 # xanadu|rapture) | |
| 79 # TOODLEDO_CMD="hotlist" | |
| 80 # ;; | |
| 81 | |
| 82 # milton) | |
| 83 # TOODLEDO_CMD="tasks *Personal" | |
| 84 # ;; | |
| 85 #esac | |
| 86 # | |
| 87 #[[ ! -f $HOME/.todo || \ | |
| 88 # `eval $TDSTAT` -lt `eval $HDATE` ]] && { | |
| 89 # echo "To-do list as of `date`" > $HOME/.todo | |
| 90 # echo "---------------------------------------------" >> $HOME/.todo | |
| 91 # toodledo tasks >> $HOME/.todo & | |
| 92 #} | |
| 93 |
