comparison .bash_aliases @ 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 82fde4c9245c
comparison
equal deleted inserted replaced
32:29dfb30b069c 33:f59f847377d7
1 # $Id$ 1 # $Id$
2 2
3 # Aliases are read from this file; no real reason to separate them out except 3 # Aliases are read from this file; no real reason to separate them out except
4 # for readability. 4 # for readability.
5 5
6 # Some settings which are architecture dependent
6 case `uname` in 7 case `uname` in
7 Darwin) 8 Darwin)
8 # DARWIN is used for the SSHFS mounts below 9 # DARWIN is used for the SSHFS mounts below
9 DARWIN="yes" 10 DARWIN="yes"
11
12 # The 'stat' and 'date' commands are here since the syntax of the commands
13 # is different between Linux and Mac OS X. If this is run elsewhere, the
14 # eval will be false and the test not done below, so it's safe to not
15 # bother checking for zero-length variables on the test - it just won't
16 # run the svn status, so you won't be prompted if there's newer files
17 # available in your repository. These are safe to export since they're
18 # the commands to be evaulated, not the output - you're storing how to get
19 # the answer, not the answer itself.
20
21 DFSTAT="stat -f %m -t %s $HOME/.dotfilets"
22 MDATE="date -v -1m +%s"
23 TDSTAT="stat -f %m -t %s $HOME/.todo"
24 HDATE="date -v -1h +%s"
25
10 alias ls='ls -FG' 26 alias ls='ls -FG'
11 ;; 27 ;;
12 28
13 Linux) 29 Linux)
30 # See above for a description of these four
31 DFSTAT="stat -c %Y $HOME/.dotfilets"
32 MDATE="date -d \"1 month ago\" +%s"
33 TDSTAT="stat -c %Y $HOME/.todo"
34 HDATE="date -d \"1 hour ago\" +%s"
35
14 alias ls='ls --color=auto -F' 36 alias ls='ls --color=auto -F'
15 ;; 37 ;;
16 esac 38 esac
39
40 # Export some of those above for the benefit of future shells
41 export DFSTAT MDATE TDSTAT HDATE
17 42
18 # SSH aliases 43 # SSH aliases
19 alias dh='ssh srhuston.net' 44 alias dh='ssh srhuston.net'
20 alias dvra='ssh dvra@laurel.dreamhost.com' 45 alias dvra='ssh dvra@laurel.dreamhost.com'
21 alias j='ssh joshua.srhuston.net' 46 alias j='ssh joshua.srhuston.net'
50 alias sx="sshfs -oreconnect${DARWIN:+,volname=Xanadu} xanadu.astro.princeton.edu: $HOME/xanadu" 75 alias sx="sshfs -oreconnect${DARWIN:+,volname=Xanadu} xanadu.astro.princeton.edu: $HOME/xanadu"
51 76
52 # Other 77 # Other
53 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog /scr/chimera0/condor/hosts/*/log/MasterLog" 78 alias condor_check="ls -lat /u/condor/hosts/*/log/MasterLog /scr/chimera0/condor/hosts/*/log/MasterLog"
54 79
80 # Functions
81 update_toodledo() {
82 case `hostname -s` in
83 xanadu|rapture)
84 TOODLEDO_CMDS="toodledo tasks *Work; toodledo tasks *Personal"
85 ;;
86
87 milton)
88 TOODLEDO_CMDS="toodledo tasks *Personal"
89 ;;
90 esac
91
92 [[ -e $HOME/.todo.$$ ]] && return
93
94 echo "To-do list as of `date`" > $HOME/.todo
95 echo "---------------------------------------------" >> $HOME/.todo
96 eval $TOODLEDO_CMDS | egrep -v ' -- !negative' >> $HOME/.todo.$$
97 egrep '^<[0-9]+>' $HOME/.todo.$$ | egrep '#\[[0-9]+/[0-9]+/[0-9]+' | sort -k 4.3 >> $HOME/.todo
98 egrep '^<[0-9]+>' $HOME/.todo.$$ | egrep -v '#\[[0-9]+/[0-9]+/[0-9]+' >> $HOME/.todo
99 rm $HOME/.todo.$$
100 }
101
55 # vim: set filetype=sh : 102 # vim: set filetype=sh :