back
#controllo volume
### volume ###
vd() {
amixer set Master 1-| grep -o '\[.*%\]'|tail -n1
}
vu() {
amixer set Master 1+| grep -o '\[.*%\]'|tail -n1
}
#ricerche nel web tramite il browser w3m
#es: yahoo debianizzati
### web search ###
#yahoo
yahoo() {
  echo -e "\033[32msearching Yahoo for $*"
  local SEARCH=$(echo $* | sed -e 's/ /\%20/g')
  echo -e "\033[32mtranslating search to URL speak..."
  w3m http://it.search.yahoo.com/search?p="$SEARCH"
}
#ricerche tramite wordreference
wrenit() {
  echo -e "\033[32msearching WordReference for $*"
  local SEARCH=$(echo $* | sed -e 's/ /\%20/g')
  echo -e "\033[32mtranslating search to URL speak..."
  w3m http://www.wordreference.com/enit/"$SEARCH"
}
writen() {
  echo -e "\033[32msearching WordReference for $*"
  local SEARCH=$(echo $* | sed -e 's/ /\%20/g')
  echo -e "\033[32mtranslating search to URL speak..."
  w3m http://www.wordreference.com/iten/"$SEARCH"
}
#ricerche tramite wikipedia
wikit() {
  echo -e "\033[32msearching Wikipedia for $*"
  local SEARCH=$(echo $* | sed -e 's/ /\%20/g')
  echo -e "\033[32mtranslating search to URL speak..."
  w3m http://it.wikipedia.org/wiki/"$SEARCH"
}
wiken() {
  echo -e "\033[32msearching Wikipedia for $*"
  local SEARCH=$(echo $* | sed -e 's/ /\%20/g')
  echo -e "\033[32mtranslating search to URL speak..."
  w3m http://en.wikipedia.org/wiki/"$SEARCH"
}
#converte testo in html tramite vim
#necessita di vim e non vim-tiny
### text2html ###
2html() {
  if [ $# -lt 1 ] || [ $# -gt 2 ]; then
   echo -e "\033[32mconvert text to html"
   echo -e "\033[32musage: 2html filename"
  else
   vim -n -c 'so $VIMRUNTIME/syntax/2html.vim' -c 'wqa' $1 \ 
     > /dev/null 2> /dev/null
  fi
}
#converte testo in ps e successivamente in pdf
#es: 2pdf .bashrc
### text2pdf ###
2pdf() {
   a2ps $1 --borders=0 -1 -f 10 -B -q -o - | ps2pdf - $1.pdf
}
back