Skip to content

Commit

Permalink
Updates bashrc stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Tao committed Sep 22, 2011
1 parent 0bb5fbc commit b38e349
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 13 deletions.
55 changes: 55 additions & 0 deletions bash_aliases
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#!/bin/bash

# Play classical96.3 without Flash
alias classical='mplayer http://stream.classical963fm.com:8017'

# Monitor the xclip for URLs and auto-open
xclip-open () {
xco=$(xclip -o)
while sleep 0.2 ; do
xc=$(xclip -o)
[[ $xc = $xco ]] && continue
[[ $xc = http* || $xc = www* ]] || continue
xco="$xc"
firefox "$xc"
done
}
xo () { xclip-open ; }

# See what changed on my MP3 player
commpodcasts () { comm -3 <(ls ~/c/PODCASTS/) ~/Downloads/podcasts/loaded ; }

# Sync my MP3 player
syncpodcast () {
if ! [[ -d ~/c/PODCASTS ]] ; then
echo "Mount MP3 Player"
return 1
fi
rsync -ahv --del ~/Downloads/podcasts/toLoad/ ~/c/PODCASTS/
ls ~/c/PODCASTS > ~/Downloads/podcasts/loaded
sync
umount ~/c
}

# Add a file to my download queue
dl() { exec 3>~/downloadqueue ; printf "%s\n" "$@" >&3 ; }

# Count seconds
stopwatch () { SECONDS=0 ; while sleep 1; do clear ; echo ; echo $SECONDS | figlet ; done ; }

# Bring up/down my encfs
alias encUp='encfs ~/enc/.data ~/enc/data'
alias encDown='fusermount -u ~/enc/data/'

alias amixer='sudo amixer'
alias io='iotop -d 30 -o -P -k'
alias s='[[ $TERM = *screen* ]] || ssh goodi.gotdns.com'
alias pw='$HOME/bin/pw/setup'
alias x="while sleep 1 ; do date >> ~/x.log ; startx >>~/x.log 2>&1 & wait || break ; sleep 10 || break ; done"
update ()
{
unset TMOUT ; day=$( date +%F ); last=$( < ~/.update.last );
[[ $day != $last ]] && echo -n $day > ~/.update.last && sudo pacman -Syu
}


15 changes: 2 additions & 13 deletions bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@

# A bunch of useful stuff to source from ~/.bashrc or ~/.bash_profile

# Sleep spin until a file appears. $1 is filename. $2 is optional sleep length
waitforfile () {
(( $# == 1 || $# == 2 )) || return 1
local file="$1"
local delay="${2:-30}"
until [[ -f $file ]] ; do sleep "$delay" ; done
return 0
}
# Wait for the file then remove it
waitonceforfile () {
waitforfile "$@" && rm "$1"
}

shopt -s nullglob
for i in ~/.bash/* ; do . "$i" ; done
alias c=clear
alias ls='ls --color=auto'

Expand Down

0 comments on commit b38e349

Please sign in to comment.