This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

d0od

By: a guest on Oct 28th, 2009  |  syntax: Bash  |  size: 1.22 KB  |  views: 3,020  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!/bin/sh
  2. # Adium theme AdiumMessageStyle installer for Empathy
  3. # Originally 2009 Antono Vasiljev
  4. # Licensed under the same terms as Empathy
  5. # http://antono.info/en/165-install-adium-themes-to-empathy
  6. # Changed by Vertlo Oraerk (did not work with directories containing spaces in the names)
  7.  
  8. if [ -z $1 ]
  9. then
  10.     echo
  11.     echo "Usage:"
  12.     echo "`basename $0` adiumxtra://some.url.here/extra"
  13.     echo
  14.     exit 1
  15. else
  16.     TMPDIR=`mktemp --directory`
  17.     XTRAURL=`echo $1 | sed -e "s/^adiumxtra:/http:/"`
  18.     DEST="$HOME/.local/share/adium/message-styles/"
  19.     if [ ! -d $DEST ]
  20.     then
  21.         mkdir -v -p $DEST
  22.     fi
  23.  
  24.     cd $TMPDIR
  25.     echo "Downloding extra..."
  26.     wget --no-verbose -O xtra.zip $XTRAURL
  27.     unzip -qq xtra.zip
  28.  
  29.     ls -d ./*.AdiumMessageStyle/ > themes_to_copy.lst
  30.     num_bytes=`wc -c themes_to_copy.lst | sed 's# themes_to_copy.lst##'`
  31.  
  32.     if [ $num_bytes = 0 ]
  33.     then
  34.         echo "No themes found in downloaded file"
  35.     else
  36.         while read line
  37.         do
  38.             echo cp -r \'$line\' "$DEST" | sh
  39.         done < themes_to_copy.lst
  40.         echo
  41.         echo "Theme $XTRAURL was succesfully installed to $DEST"
  42.     fi
  43.     rm xtra.zip
  44.     rm -r $TMPDIR
  45. fi
  46. exit 0
clone this paste RAW Paste Data