Mercurial > hg > config
comparison .bashrc @ 274:102305dad796
fun notes to self
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Fri, 05 Apr 2013 15:56:46 -0700 |
parents | eacc4c5ed628 |
children | 19070b2af257 |
comparison
equal
deleted
inserted
replaced
273:71e5879500a7 | 274:102305dad796 |
---|---|
213 mv $NEWNAME `basename $2` | 213 mv $NEWNAME `basename $2` |
214 } | 214 } |
215 | 215 |
216 isrunning() { | 216 isrunning() { |
217 # is a process running? (by name) | 217 # is a process running? (by name) |
218 # see also: talos for a better version | |
218 for i in "$@" | 219 for i in "$@" |
219 do | 220 do |
220 ps axwww | grep "$i" | grep -v 'grep' | 221 ps axwww | grep "$i" | grep -v 'grep' |
221 done | sort | uniq | 222 done | sort | uniq |
222 | 223 |
223 } | 224 } |
224 | 225 |
225 killbyname() { | 226 killbyname() { |
226 # kill a process by name | 227 # kill a process by name |
228 # see also: talos for a better version | |
227 kill `isrunning "$@" | awk '{ print $1 }' | onelineit.py` | 229 kill `isrunning "$@" | awk '{ print $1 }' | onelineit.py` |
228 } | 230 } |
229 | 231 |
230 # full name | 232 # full name |
231 fn() { | 233 fn() { |
298 fi | 300 fi |
299 cd - | 301 cd - |
300 } | 302 } |
301 | 303 |
302 hgrc() { | 304 hgrc() { |
305 # write an hgrc file | |
306 # TODO: in the case you're in an `hg root`...what then? | |
307 # - NOTE: /home/jhammel is an `hg root`, so be careful! | |
308 # There should be a way to update $(hg root)/.hg/hgrc automatically | |
309 # Likewise, git | |
310 # Python script? .dotfile? | |
303 ROOT="${1}" | 311 ROOT="${1}" |
304 echo "[paths]" | 312 echo "[paths]" |
305 echo "default = ${ROOT}" | 313 echo "default = ${ROOT}" |
306 echo "default-push = ssh://${ROOT#http*://}" | 314 echo "default-push = ssh://${ROOT#http*://}" |
307 } | 315 } |
363 if [ -e $MENU ] | 371 if [ -e $MENU ] |
364 then | 372 then |
365 html2flux.py $MENU > ~/.fluxbox/applications | 373 html2flux.py $MENU > ~/.fluxbox/applications |
366 fi | 374 fi |
367 } | 375 } |
368 | |
369 regeneratefluxmenu | 376 regeneratefluxmenu |