6
# Licensed under GPL v2
10
# Documentation Portion
14
# Menu Entry Name for Selector:
17
#*****************************************************************************#
18
#* This installs themes packaged in .x10theme format. *#
19
#* Other formats (fe. chewitts installer, custom install.sh) are NOT usable. *#
20
#*****************************************************************************#
31
# Variables for Windows
32
# Path for windows is set in its bat-file
35
elif [ "`uname`" = "Linux" ]
39
# Initialising adb with a request for root permissions
40
# since it otherwise decides to fail with
41
# "not enough permissions to access device"
44
PATH=$PATH:"$croot/program/bin/lin/"
45
cd "$croot/program/bin/lin/"
47
echo "Starting Android Debug Bridge. Need Root Permissions. Using Sudo:"
51
echo "Couldn't find supported OS. Aborting."
54
if [ ! $(($adb devices | grep -v "devices")) ]
56
echo "Can't find an attached phone! Please connect your phone and re-start the task."
64
# echo out the info from config-files
68
strings $4 | grep "^\#\*.*\*#$"
69
echo "Press Enter to return to menu"
81
# Extract Configuration for Usage
82
# $1 -> config file to use
84
cp "$croot/config/$1" "$cfgtmp/"
91
if [ -e "customization.tgz" ]
93
tar -xzf "customization.tgz"
94
rm "customization.tgz"
104
# If there's already a config-tmp directory, delete it and put an empty one
105
# into its place for population with new cfg files.
108
cfgtmp="$croot/program/tmptheme"
121
if [ ! `ls -1 *.x10conf | wc -l` = "0" ]
123
for conf in `ls -1 *.x10theme`
125
ccount=$(($ccount+1))
129
echo "Found the following configurations: "
131
for i in `seq 1 $ccount`
133
echo " $i. `strings ${conff[$i]} | grep "\#N\ " | sed -e "s_\#N\ __g"`"
136
echo "Use 'ask #' to get help on what each theme is specifically."
137
printf "Please select which one to use (enter 0 for backup): "
140
if [ `echo $choice | grep "ask\ [0-9]"` ]
142
show_info $0 $1 $2 ${conff[`echo $choice | sed -e "s_ask\ __"`]}
143
elif [ "$choice" = "0" ]
145
echo "Using Default Configuration as base"
147
$adb pull /sdcard/backup/theme/
148
elif [ "$choice" -le "$ccount" ]
150
echo "Using ${conff[$choice]} as base."
151
excfg "${conff[$choice]}"
154
echo "Can't seem to find the file you chose. Aborting."
156
bash ./program/selector "$croot"
159
echo "No Themes found. Aborting."
163
cd "$croot/program/bin"
164
bash "$2" "$croot" "true" 2> "$croot/local-logs/$2.txt"