Notices


Reply
Thread Tools
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#31
EDIT: FORGET USING INIT.D ON MAEMO! FOR STARTING YOUR OWN SCRIPTS RUN IT VIA EVENT.D! LOOK DOWN THIS SITE FOR AN EXAMPLE! ;D

QUESTION: ^^

Code:
#! /bin/sh
# /etc/init.d/rvid

# Carry out specific functions when asked to by the system
case "$1" in
  start)
    cd /etc/hildon-welcome.d/dconfs/

    if [ -f 1.conf ]; then

    # determine number of files in /dconfs
    nof=$(ls *.conf | wc -l)

    # get random number
    rna=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")
    rna=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

    if [ $rna -ge $rnb ]; then
    let "rn = $rna - $rnb"
    else
    let "rn = $rnb - $rna"
    fi

    # in range of 1 - nof
    let "rr = $rn % $nof + 1"

    # choose random conf
    rf="$rr.conf"
    echo "$rr.conf"

    # copy it over to default.conf
    cp $rf ../default.conf

    fi 
    ;;
  stop)
    ;;
  *)
    ;;
esac

exit 0
source: http://www.debian-administration.org...me_with_Debian

then doing:
Code:
chmod 755 /etc/init.d/rvid
update-rc.d rvid defaults
is this the correct way for launching my script on bootup? o.O

Last edited by b666m; 2010-02-20 at 06:21.
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#32
mkay... doesn't work... i can't get it work...

so you have to stick to the shortcut-method until someone points me the direction to launch my script on startup. ^^

the only thing i could do in addition would be checking which bootvideo is currently used so that another default.conf gets loaded.

(in my current version the same bootvideo can be played several times because maybe the default.conf gets overwritten by the same default.conf)

so... if you want to have a new bootvideo each time you click the shortcut... leave a comment here... ^^
(or program it by yourself ;D)
 

The Following User Says Thank You to b666m For This Useful Post:
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#33
omg.... i've done so much... just look at my friggin' battery drainage xD

(see this straight drop of about 30%??? this is how multiple reboots (about mhm... 5?!) look like )
Attached Images
 

Last edited by b666m; 2010-02-20 at 04:22.
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#34
first things first ^^

new script which will check the currently used video so that it's always another video on bootup

(ok... if you run it for the first time it may be not changing the video because my check-file doesn't exist in this moment but it will be created then ^^)

Code:
blablabla... same as in the code under this code.. blablabla

    # get random number
    rn=$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" ")

    blablabla... the same again... blablabla
EDIT: i kicked the /dev/urandom number generation because the entropy pool is sparely seeded. so i'll use the seconds since 00:00:00, Jan 1, 1970 ^^

Code:
start on starting shutdown

script

  cd /etc/hildon-welcome.d/dconfs/

  if [ -f 1.conf ]; then

    # check which file is currently used
    if [ -f *.lock ]; then
      cuf=$(ls *.lock)
      ruf=$cuf
      rm *.lock
    else
      cuf="1.lock"
      ruf=$cuf
    fi

    # determine number of files in /dconfs
    nof=$(ls *.conf | wc -l)

    while [ "$ruf" = "$cuf" ]; do

      # get "random" number lol
      rn=$(date +%s)

      # in range of 1 - nof
      let "rr = $rn % $nof + 1"

      # choose random conf
      ruf="$rr.lock"
      rf="$rr.conf"
 
    done
 
    # set file for checking which file is in use
    rb="$rr.lock"

    # copy it over to default.conf
    cp $rf ../default.conf
    touch $rb

  fi

end script
how it works:
Attached Images
 

Last edited by b666m; 2010-02-21 at 16:51.
 

The Following User Says Thank You to b666m For This Useful Post:
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#35
and...
YEAH BABY!!!

got it replaced automatically... even before the video is loaded ^^ *hrhr*

instructions:

1. download the zip-file and place file "rvid" in ~/MyDocs/ranvid/ (for example)
2. open xterm
3. type "sudo gainroot"
4. type "cp MyDocs/ranvid/rvid /etc/event.d/"
5. type "chmod 777 /etc/event.d/rvid"

if you haven't done it yet:
8. type "mkdir /etc/hildon-welcome.d/dconfs"
9. place your default.conf files there BUT rename them in 1.conf, 2.conf, 3.conf and so on.

so the contents should be:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.

ehm yeah... have fun

edit: forgot to mention... this one is the code which will always replace the current bootvideo with any other bootvideo out of the x.conf files (:

EDIT: UPDATED TO FINAL VERSION. ^^
Attached Files
File Type: zip rvid.zip (469 Bytes, 117 views)

Last edited by b666m; 2010-02-22 at 02:05.
 

The Following 5 Users Say Thank You to b666m For This Useful Post:
Posts: 527 | Thanked: 121 times | Joined on Feb 2010
#36
You are my member of the month in here..
Always there, always helpfull and in here for others as well..

Bravo!

Will test and try later

================================================== =========
Did it all but not working for me.
So I guess I made a mistake...

To verify:

I kept the default.conf file in etc/hildon-welcome.d

With your tweak exicuted it keeps on booting with hands...
I think it is because of that default.conf in there.
I will try to delete that one so it will use the hildon-welcome.d/donfs



Midleading as you stated how the contents must look

Last edited by rolan900d; 2010-02-20 at 12:10.
 
Posts: 527 | Thanked: 121 times | Joined on Feb 2010
#37
Now I left default.conf in /etc/hildon-welcome.d.
with also 6 others (named the default1.conf until default6.conf)

These 7 default conf files I copied and renamed them 1.conf until 7.conf and placed them in /etc/hildon-welcome.d./dconfs

This gave me a lot of videos in a continious loop!
It showed 5 of the 7 and 2 I could hear but didn't see

So I did something wrong I guess


In your described progress I cam acroos on error on my end..
1. download the zip-file and place the two files "rvid" and "rvide" (for example) in ~/MyDocs/ranvid/
2. open xterm
3. type "sudo gainroot"
4. type "cp ranvid/rvid /usr/bin/"
5. type "chmod 777 /usr/bin/rvid"
6. type "cp ranvid/rvide /etc/event.d/"

At 4 and 6 in needed to put this between cp and ranvid due to errors

/home/user/MyDocs/

Last edited by rolan900d; 2010-02-20 at 12:33.
 
b666m's Avatar
Posts: 1,090 | Thanked: 476 times | Joined on Jan 2010 @ Ingolstadt, Germany
#38
ONLY have ONE default.conf in /etc/hildon-welcome.d/

(delete all other defaultx.conf files!)

just let the x.conf files in /etc/hildon-welcome.d/dconfs/

to make it clear. it must look like:

/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.
 
Posts: 527 | Thanked: 121 times | Joined on Feb 2010
#39
I did that but than only the hands animation runs.
My default.conf is the hands one
 
Posts: 527 | Thanked: 121 times | Joined on Feb 2010
#40
Originally Posted by b666m View Post
ONLY have ONE default.conf in /etc/hildon-welcome.d/

(delete all other defaultx.conf files!)

just let the x.conf files in /etc/hildon-welcome.d/dconfs/

to make it clear. it must look like:

/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/1.conf
/etc/hildon-welcome.d/dconfs/2.conf
/etc/hildon-welcome.d/dconfs/3.conf
... and so on.
I had this understood from the get go but didn't do anything for me...
Just booted on hands
 
Reply


 
Forum Jump


All times are GMT. The time now is 14:02.