Advertisement
Guest User

d0od

a guest
Oct 28th, 2009
3,355
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.22 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement