Results 1 to 7 of 7
  1.    #1  
    So my project the past few days has been a way to get themes installed on my phone without having to WinSCP files or blindly copy large directories to the phone. My idea was a simple script that would just copy the theme files, and restart luna.

    I made a few that were specific to the themes themselves... if one was just launcher icons, I could run a script and it would copy the files over and restart luna. Nice and simple.

    But now, I want to make a script that will sit one directory up from the themes, ask upon running which one you want to install out of X list, and install from there.

    The main question I have is, how do I have it read the themes available? Could I just echo another file that lists the themes themselves (Like having a main theme.sh, and a themelist.list), or is there a way to parse the directory and list all the directorie's names? Such as, having a themes in folders called 'blue' and 'red', and when I run the script have it say:
    "Which theme do you want to install?
    1) Blue
    2) Red"

    My original idea was to just manually update the listing the the first .sh file, and have it point to each individual theme's .sh which houses the correct commands to copy the theme over. I went with this since some are just launcher icons, and others are full on, every .png on the phone replaced, themes.

    Ideally I would like to have a folder named 'themes'. CD into the themes directory and run themes.sh, and be able to install themes from there over ssh. I'm just looking for some guidance. Can anyone enlighten me?
  2. #2  
    Quote Originally Posted by caferacer View Post
    So my project the past few days has been a way to get themes installed on my phone without having to WinSCP files or blindly copy large directories to the phone. My idea was a simple script that would just copy the theme files, and restart luna.

    I made a few that were specific to the themes themselves... if one was just launcher icons, I could run a script and it would copy the files over and restart luna. Nice and simple.

    But now, I want to make a script that will sit one directory up from the themes, ask upon running which one you want to install out of X list, and install from there.

    The main question I have is, how do I have it read the themes available? Could I just echo another file that lists the themes themselves (Like having a main theme.sh, and a themelist.list), or is there a way to parse the directory and list all the directorie's names? Such as, having a themes in folders called 'blue' and 'red', and when I run the script have it say:
    "Which theme do you want to install?
    1) Blue
    2) Red"

    My original idea was to just manually update the listing the the first .sh file, and have it point to each individual theme's .sh which houses the correct commands to copy the theme over. I went with this since some are just launcher icons, and others are full on, every .png on the phone replaced, themes.

    Ideally I would like to have a folder named 'themes'. CD into the themes directory and run themes.sh, and be able to install themes from there over ssh. I'm just looking for some guidance. Can anyone enlighten me?

    I thought themes were being packaged as ipk so installation is pretty simple?

    as for shell script to list subdirs...

    for i in `ls`
    do
    echo $i
    done
  3.    #3  
    Quote Originally Posted by emoney_33 View Post
    I thought themes were being packaged as ipk so installation is pretty simple?

    as for shell script to list subdirs...

    for i in `ls`
    do
    echo $i
    done
    Some are and some aren't.

    There are also some themes I am only installing portions of on my device.

    That's why I am making the script, and why I need some help
  4. #4  
    Quote Originally Posted by caferacer View Post
    Some are and some aren't.

    There are also some themes I am only installing portions of on my device.

    That's why I am making the script, and why I need some help

    ipk installation simply unpacks the files in place, so just bundling any file you want to overwrite into an ipk with the correct directory structure would be the easiest way to do this
  5.    #5  
    Quote Originally Posted by emoney_33 View Post
    ipk installation simply unpacks the files in place, so just bundling any file you want to overwrite into an ipk with the correct directory structure would be the easiest way to do this
    I understand that might be easier, but because I am stuck on this one section of the script, I also just want to know how to make the script act how I want to.

    It's less 'I want it to do this' and more 'I'm curious how something like this would work' kinda deal.
  6. #6  
    Quote Originally Posted by caferacer View Post
    I understand that might be easier, but because I am stuck on this one section of the script, I also just want to know how to make the script act how I want to.

    It's less 'I want it to do this' and more 'I'm curious how something like this would work' kinda deal.

    I answered your main question above, what exactly would you like to know how to do in the shell script?
  7. phwelo's Avatar
    Posts
    527 Posts
    Global Posts
    554 Global Posts
    #7  
    i made something like this for installing patches awhile back:
    a=0
    for inputline in $(find /opt/src/modifications -name *.patch | sort)
    do
    a=$(($a+1));
    line="$(echo $inputline)"
    MYARRAY[$a]="$line"
    echo "${a}${line}" | awk -F "/" 'sub(".patch","",$6) {printf "%-3s %-15s %s\n", $1, $5, $6}'
    done
    echo "q quit"

    x=$(($a+1));
    until [ -n "$opt" ] ; do
    read -p "Enter the line number for patch to apply [1 - $a] " opt
    if [ "$opt" = "q" ] ; then
    exit 0
    fi
    if [ "$opt" -lt "$x" 2> /dev/null ] && [ "$opt" -gt 0 2> /dev/null ] ; then
    true
    else
    opt=""
    fi
    done
    perhaps that might help? i read them from an array but you wouldn't have to do all that, just echo them and then ask for input..

    on a separate note i believe installation for themes using a script is the only way to go. ipk isn't made for this type of thing, and has anyone tried uninstalling one of these packages yet? it's a mess. since you can't uninstall them you end up having to write packages on top of one another. of course i never finished my project - because i never do nowadays - but i had written a script for installing a couple of themes that i made and in that script i had written in a backup sequence and an option to restore as well. this is a big benefit.
    http://phwelo.mobi
    for any questions or to send a donation: phwelo@gmail.com

Posting Permissions