maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Design (https://talk.maemo.org/forumdisplay.php?f=46)
-   -   Multiple boot videos? (https://talk.maemo.org/showthread.php?t=43840)

Psymastr 2010-02-09 04:42

Multiple boot videos?
 
Is there a way to chain boot videos so one plays after the other? (I tried searching, but couldn't find any info for a yes or a no). Such as in the boot video config just writing:

filename=xx.avi
filename=yy.avi?

Or is it not possible?

maxximuscool 2010-02-09 05:29

Re: Multiple boot videos?
 
yes you can. just do what you did above. it will work.

bandora 2010-02-09 05:32

Re: Multiple boot videos?
 
Lol but why? Like do you really want to wait for those videos to load? idk.. just curious.. :o

Sunderland 2010-02-09 08:00

Re: Multiple boot videos?
 
Maybe he wants to have defferent videos on each reboot?
i mean he loads up his phone and have xx.avi boot video, and next time he will reboot N900 he'll have yy.avi boot video.

sry for poor eng.

bandora 2010-02-09 22:03

Re: Multiple boot videos?
 
Oh.. so when having multiple entries then it will play one each time? I thought it plays them one after another in one boot.

kopte3 2010-02-10 00:17

Re: Multiple boot videos?
 
No, if you have multiple entries it will always play all of them in order you wrote them in your conf file.

rolan900d 2010-02-12 13:59

Re: Multiple boot videos?
 
Not working for me...

I did this setup:

[hildon-welcome]
filename=maemo_flyby_xvid_lame_r3.avi
filename=short.avi


But it just plays short.avi

All the names are right of the videos!

rolan900d 2010-02-13 19:08

Re: Multiple boot videos?
 
I found it...
I need to make 2 config files like this:

default.conf
default2.conf

Ahmed360 2010-02-13 20:01

Re: Multiple boot videos?
 
oh so it can be done

ignore my PM rolan900d

But....why?!!!

rolan900d 2010-02-14 01:31

Re: Multiple boot videos?
 
Why, I like to be weird!
:p

neboja 2010-02-17 23:24

Re: Multiple boot videos?
 
ok... so you make a bunch a config files, and every time you boot, it plays a diferent movie??? wright??? O_o

Pfuh3z 2010-02-18 15:53

Re: Multiple boot videos?
 
Quote:

Originally Posted by neboja (Post 533274)
ok... so you make a bunch a config files, and every time you boot, it plays a diferent movie??? wright??? O_o

No, every time you boot, it plays all the movies referenced to by your config files. "Random" movie during boot would be a cooler feature though :)

Dries

b666m 2010-02-18 16:10

Re: Multiple boot videos?
 
Quote:

Originally Posted by rolan900d (Post 525030)
I found it...
I need to make 2 config files like this:

default.conf
default2.conf

if this really works...

you could store all of those files in an additional folder ../dconfs (for example).
then write a script which deletes the current defaultX.conf in the hildon/welcome folder and randomly copies any of the configs in /dconfs back when shutting the system down.

this script could be stored in /etc/init.d/. then you have to symlink it to the correct rcX.d folder, i guess it would be rc0.d (http://en.wikipedia.org/wiki/Runlevel).

ehm yeah... the script should then be executed when your system goes into halt?! o.O

and you'll always have a random video at (re)boot. ^^

edit: maybe it would be the best to change it on bootup with a rc2.d script :)

EDIT: THAT'S MY FINAL SOLUTION FOR HAVING RANDOM BOOTVIDEOS ON STARTUP AUTOMATICALLY -> http://talk.maemo.org/showpost.php?p...5&postcount=35

rolan900d 2010-02-18 17:04

Re: Multiple boot videos?
 
On my end it could only play 2 videos on boot!
The 3rd and 4rd worked but only for sound..

b666m 2010-02-18 17:25

Re: Multiple boot videos?
 
that would be a quick&dirty script for replacing the default.conf

you have:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/ <- new folder where the configs are named "1.conf", "2.conf", "3.conf" and so on.

the script determines the number of conf-files in the dconfs-folder and replaces the default.conf randomly with one of them :)

Code:

#!/bin/bash

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

# get random number in range of 1 - nof
let "rn = $RANDOM % $nof + 1"

# choose random conf
rf="$rn.conf"

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

# exit
exit 0


vietn900 2010-02-18 17:32

Re: Multiple boot videos?
 
mightm as well put on a whole movie ;p

silverstar29 2010-02-18 18:16

Re: Multiple boot videos?
 
Hey Rolan900d,

I tried creating 2 default files.

default.conf

[hildon-welcome]
filename= (Hand boot screen)

And default2.conf

[hildon-welcome]
filename=short.avi

But It didn't work. Still shows only the Hands as intro and thats it.

b666m 2010-02-18 18:56

Re: Multiple boot videos?
 
you could also make desktop-shortcut which executes the script or only the code (as one-liner) when you want to have a another/random bootvideo next time. xD

rolan900d 2010-02-18 20:08

Re: Multiple boot videos?
 
Quote:

Originally Posted by b666m (Post 534839)
that would be a quick&dirty script for replacing the default.conf

you have:
/etc/hildon-welcome.d/default.conf
and
/etc/hildon-welcome.d/dconfs/ <- new folder where the configs are named "1.conf", "2.conf", "3.conf" and so on.

the script determines the number of conf-files in the dconfs-folder and replaces the default.conf randomly with one of them :)

Code:

#!/bin/bash

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

# get random number in range of 1 - nof
let "rn = $RANDOM % $nof + 1"

# choose random conf
rf="$rn.conf"

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

# exit
exit 0


I was really good in Symbian, but so a noob in Linux...
Learning a lot over here, but you are out of my league mate!


@b66m:
That would be great; but I got lost on that script...

b666m 2010-02-18 20:14

Re: Multiple boot videos?
 
outsch... too bad... $RANDOM doesn't deliver anything... this command isn't recognized at the n900 :/

b666m 2010-02-18 21:24

Re: Multiple boot videos?
 
1 Attachment(s)
wuhaha :D
got it ^^

Code:

#!/bin/bash

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

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

# 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

# exit
exit 0

the new random number generator looks quite ugly but it works (look at the pic at the bottom)
(i only have 2 confs in the dconfs-folder ^^)

maybe i'll try to get it in rc2.d :)
a shortcut on the desktop (for doing it manually) to this script is done very fast (:

b666m 2010-02-18 22:11

Re: Multiple boot videos?
 
if anybody is interested in this random bootvideo shortcut on the desktop. i could write a short how-to :)

Schturman 2010-02-19 05:47

Re: Multiple boot videos?
 
Hi b666m
Can you write please the "how-to" for a noob in Linux....

1) How-to random video automaticly

2) How-to random bootvideo shortcut on the desktop

Thanks

rolan900d 2010-02-19 09:20

Re: Multiple boot videos?
 
Quote:

Originally Posted by b666m (Post 535445)
if anybody is interested in this random bootvideo shortcut on the desktop. i could write a short how-to :)

I really would like a step by step as well...
Than I will get smarter in this

b666m 2010-02-19 20:29

Re: Multiple boot videos?
 
1 Attachment(s)
omg... the shortcut wasn't as easy as i thought it would be... but finally it's working...

instructions:
1. download the zip-file and unpack the two files anywhere in a new folder in your MyDocs. for example: ~/MyDocs/randomvid/
(unplug usb cable)
2. open xterm and type "sudo gainroot"
3. type "mkdir /etc/hildon-welcome.d/dconfs"
4. in this folder you have to store your default.conf files named 1.conf, 2.conf, 3.conf and so on (you have to start with 1 and then incremental count up (2, 3, 4, 5,...))
5. type "cd MyDocs/randomvid/"
6. type "cp rvid.sh /etc/hildon-welcome.d/"
7. type "chmod a+x /etc/hildon-welcome.d/rvid.sh"
8. type "cp rvid.desktop /usr/share/applications/hildon/"
9. close xterm, go to your desktop and add the shortcut named "rvid".

it uses the terminal-icon. if you want your own icon do following:
1. place a .png with 48 * 48 px in /usr/share/icons/hicolor/48x48/hildon/
(for example: rvid.png)
2. open the rvid.desktop with a editor and change the icon-line to:
"Icon=rvid". save it.
3. you may have to reboot your device.

thanks go to:
fatalsaint for pointing me in the right direction with the desktop file.
(http://talk.maemo.org/showpost.php?p...7&postcount=66)
subcore for hack-around changing xterm to busybox.
(http://talk.maemo.org/showpost.php?p...9&postcount=11)
archebyte for changing the desktop-icon and some other neat work.
(http://talk.maemo.org/showpost.php?p...0&postcount=26)

edit:
it's normal that the terminal opens up, stays black and closes after a few seconds.
it's also normal that it may replaces the current default.conf with the same config - so your video may not change everytime you click on it. but hey... that's randomness ;D

EDIT: updated the rvid.sh with new code with generates random number out of date and checks which default.conf is used at the moment so the video is changed every time you click it :)
(code is available on page 4 where the instructions are given on how to do this random vid change automatically ^)

b666m 2010-02-19 21:07

Re: Multiple boot videos?
 
script:
Code:

#!/bin/bash

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

# exit
exit 0

(added check if "1.conf" exists. yes: run the script and exit 0. no: quit with exit 0.)
(edit: for some reason there was 5:1 chance of 2.conf to 1.conf... so i added some more randomness by creating two random numbers and substract the smaller number from the greater one.)
(edit2: i could add some lines which force the bootvideo to change. in the current version the default could be replaced by the same file and the bootvideo would still be the same. good idea? bad idea?!)

desktop:
Code:

[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Terminal=true
Name=rvid
Exec=/bin/busybox sh -c 'echo sh /etc/hildon-welcome.d/rvid.sh | sudo gainroot'
Icon=terminal
#X-Window-Icon=
X-Window-Icon=   
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable


Schturman 2010-02-19 21:20

Re: Multiple boot videos?
 
where I need put the video files ? to /MyDocs/randomvid/ ?
or in default folder /media ?

b666m 2010-02-19 21:48

Re: Multiple boot videos?
 
Quote:

Originally Posted by Schturman (Post 537358)
where I need put the video files ? to /MyDocs/randomvid/ ?
or in default folder /media ?

0. sudo gainroot
(get root-terminal)
1. cp -r /usr/share/hildon-welcome/media /opt/
(this should make /opt/media with the nokia hands video as content)
2. rm -r /usr/share/hildon-welcome/media
(this should remove the media folder from there)
3. cd /usr/share/hildon-welcome
(change the directory ^^)
4. ln -s /opt/media media
(symlinking /opt/media to /usr/share/hildon-welcome/media)

then you can put all of your videos into /opt/media/ ;)

Schturman 2010-02-19 22:11

Re: Multiple boot videos?
 
I get this ! Thank you very much !
Another question, can we get this process automatically, without pressing on the button on desktop before reboot ? I mean on all reboot it the load another video ? (sorry for my ugly english :-) )

b666m 2010-02-19 23:31

Re: Multiple boot videos?
 
Quote:

Originally Posted by Schturman (Post 537437)
I get this ! Thank you very much !
Another question, can we get this process automatically, without pressing on the button on desktop before reboot ? I mean on all reboot it the load another video ? (sorry for my ugly english :-) )

maybe someone will write a init-script which executes my shell-script at bootup or shutdown (:

haven't done this before... but i could take a look... (better said: google could have a look ^^)

CAN ANYONE PROVIDE AN INIT SCRIPT WHICH LAUNCHES A SHELL SCRIPT? :D

b666m 2010-02-19 23:56

Re: Multiple boot videos?
 
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

b666m 2010-02-20 00:51

Re: Multiple boot videos?
 
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)

b666m 2010-02-20 04:20

Re: Multiple boot videos?
 
1 Attachment(s)
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 :D)

b666m 2010-02-20 05:39

Re: Multiple boot videos?
 
1 Attachment(s)
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:

b666m 2010-02-20 05:53

Re: Multiple boot videos?
 
1 Attachment(s)
and...
YEAH BABY!!! :D

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. ^^

rolan900d 2010-02-20 06:09

Re: Multiple boot videos?
 
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

rolan900d 2010-02-20 12:28

Re: Multiple boot videos?
 
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/

b666m 2010-02-20 12:32

Re: Multiple boot videos?
 
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.

rolan900d 2010-02-20 12:33

Re: Multiple boot videos?
 
I did that but than only the hands animation runs.
My default.conf is the hands one

rolan900d 2010-02-20 12:36

Re: Multiple boot videos?
 
Quote:

Originally Posted by b666m (Post 538343)
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


All times are GMT. The time now is 15:47.

vBulletin® Version 3.8.8