Adding debian version 0.4.0-1.
[debian/lxappearance.git] / scripts / install-icon-theme.sh
CommitLineData
08024023
DB
1#!/bin/sh
2# Script used to install new icon theme.
3# Copyright (C) 2008 paulliu, pcman
4# License: GNU GPL
5
6# test argc
7if (test $# -ne 1)
8then
9 echo Usage: $0 compressed_file
10 exit
11fi
12
13# make temp dir
14TMPDIR=`mktemp -d /tmp/icon-theme-XXXXXXX`
15
16# decompress
17if [ `basename -- $1 .tar.gz` != $1 ]
18then
19 tar -C $TMPDIR -xzf $1
20elif [ `basename -- $1 .tar.bz2` != $1 ]
21then
22 tar -C $TMPDIR -xjf $1
23fi
24
25# create destdir
26if [ -z "$XDG_DATA_HOME" ]
27then
28 export XDG_DATA_HOME="$HOME/.local/share";
29fi
30THEME_DIR="$XDG_DATA_HOME/icons"
31mkdir -p "$THEME_DIR"
32
33# install
34cd $TMPDIR
35DLIST=`find -name 'index.theme' -exec dirname {} \;`
36for DIR in $DLIST
37do
38 basename "$DIR"
39 mv -f "$DIR" "$THEME_DIR"
40done
41
42# clear temp dir
43rm -rf $TMPDIR