Page 1 of 1

Where do I edit for a program to start automatically?SOLVED

Posted: Fri 30 Aug 2013, 20:49
by oldyeller
Hello Everyone,

I would like to have a program to open right after welcome screen to closed?

Do I edit countrywizarrd or xinitrc?

Any help here would be great thanks

Posted: Fri 30 Aug 2013, 21:27
by runtt21
put a script in /root/startup

Posted: Fri 30 Aug 2013, 22:00
by oldyeller
Hi runtt21,

I have done that before. what I want to do is have a program start after a person sets-up locales, Internet and screen resolution. All of this would be after welcome1stboot.

If this can be done by putting it in /root/Startup by delays how would this be possible?

Posted: Fri 30 Aug 2013, 22:20
by Jasper
Hi,

I'm not at all sure I understand, but you might have a look at "Startmount" from 01micko which on booting can auto mount partitions and/or run apps.

My regards

Posted: Fri 30 Aug 2013, 22:39
by oldyeller
Jasper wrote:Hi,

I'm not at all sure I understand, but you might have a look at "Startmount" from 01micko which on booting can auto mount partitions and/or run apps.

My regards
I will take a look, but I don't think this will do it for me.

Posted: Fri 30 Aug 2013, 22:41
by Karl Godt
Hi oldyeller !

Probably look into /usr/sbin/delayedrun, which triggers the files in /root/Startup .

That file I think should trigger all the wizards , quicksetup and whatever they are named .
Probably pemasu and micko are the only ones that know the current firstboot structure :oops:

At least (and look for)
if [ "$PUPMODE" = 5 ] ; then
test (lines)
is needed I think for your codeblock .

Posted: Fri 30 Aug 2013, 22:44
by oldyeller
Karl Godt wrote:Hi oldyeller !

Probably look into /usr/sbin/delayedrun, which triggers the files in /root/Startup .

That file I think should trigger all the wizards , quicksetup and whatever they are named .
Probably pemasu and micko are the only ones that know the current firstboot structure :oops:

At least (and look for)
if [ "$PUPMODE" = 5 ] ; then
test (lines)
is needed I think for your codeblock .


Thanks I will look at that too.

Cheers

Posted: Sat 31 Aug 2013, 00:43
by runtt21
If you don't mind me asking, what is it you want to run?

Posted: Sat 31 Aug 2013, 01:44
by oldyeller
I am going to build a gui for desktop and appearance settings that I want to show up after welcome1stboot is killed. It is close to template for icons and for starting some other apps.

Posted: Sat 31 Aug 2013, 10:18
by disciple
Check if welcome1stboot is a script - if it is you should just edit that.

Posted: Sat 31 Aug 2013, 11:33
by 01micko
disciple wrote:Check if welcome1stboot is a script - if it is you should just edit that.
It's not, it's a compiled bacon app.

+1 for Karl's suggestion.

Posted: Sat 31 Aug 2013, 13:21
by oldyeller
01micko wrote:
disciple wrote:Check if welcome1stboot is a script - if it is you should just edit that.
It's not, it's a compiled bacon app.

+1 for Karl's suggestion.
I have looked at what Karl said about the delayedrun. just not sure on how to do it. I might have to put a script in /root/Startup that will start after welcome1stboot is closed.

Again not sure on how one would code to check when welcome1stboot is closed. I did try this. but to no avail I'm sure that it is not right.

Code: Select all

if [ welcome1stboot = killall ] then
exec welcome "!@"
fi

Posted: Sat 31 Aug 2013, 17:15
by jamesbond
oldyeller wrote:I have looked at what Karl said about the delayedrun. just not sure on how to do it. I might have to put a script in /root/Startup that will start after welcome1stboot is closed.
I'll leave this for others to answer. In Fatdog64 it is definitely /root/Startup, but not sure on other puppies.
Again not sure on how one would code to check when welcome1stboot is closed. I did try this. but to no avail I'm sure that it is not right.

Code: Select all

# the next line will wait until welcome1stboot is gone
while pidof welcome1stboot > /dev/null; do sleep 1; done
# welcome1stboot is gone, now do whatever you want to do.
do-whatever-you-want-to-do
Be careful though, you need to make sure that someone your prompt isn't automatically run after *every single boot*. That would be annoying 8)

Posted: Sat 31 Aug 2013, 17:49
by oldyeller
Hi jamesbond,

I will try this out.

I already have this happening every time Manna 2.7 remaster of lupu528-004 and it is annoying. That is the # 1 reason that I wanted to change how things start up.

Than also have it to where it does not do all the time. This should work I hope.

Cheers

Posted: Sat 31 Aug 2013, 21:03
by seaside
oldyeller,

Another approach would be to put welcome1stboot into a "wrapper" script like this -

rename /usr/sbin/welcome1stboot /usr/sbin/welcome1stboot-bin

Make script called /usr/sbin/welcome1stboot -

Code: Select all

#!/bin/sh
/usr/sbin/welcome1stboot-bin
#your script  here
exit 
When welcome1stboot is called, the above script will run and when the dialog is closed "your script here" will run.

Cheers,
s

Posted: Sat 31 Aug 2013, 21:21
by RSH
Hi.

You can put a script for that in /root/Startup.

Since the welcome1stboot is a compiled binary you can check if it is still running by 'pidof'

I'm currently running Firefox, so pidof firefox gives me 32146 as the process ID

I'm not running aqualung, so pidof aqualung give me nothing, which means, an empty string --> "" <-- returns.

You could use a loop to sleep 1 second after checking for pidof welcome1stboot is NOT "" and executing the functions of your script after pidof welcome1stboot is "".

Code: Select all

BNameOfProg="welcome1stboot"
DontRun="true"
while [ "$DontRun" = "true" ];
do
	if [ "`pidof "'$BNameOfProg'"`" != "" ]; then
		echo "'$BNameOfProg' is still running"
		sleep 1
		else
		echo "'$BNameOfProg' has been exited"
		DontRun="false"
	fi
done

Your script functions here
This should help.

Posted: Sat 31 Aug 2013, 21:35
by oldyeller
seaside wrote:oldyeller,

Another approach would be to put welcome1stboot into a "wrapper" script like this -

rename /usr/sbin/welcome1stboot /usr/sbin/welcome1stboot-bin

Make script called /usr/sbin/welcome1stboot -

Code: Select all

#!/bin/sh
/usr/sbin/welcome1stboot-bin
#your script  here
exit 
When welcome1stboot is called, the above script will run and when the dialog is closed "your script here" will run.

Cheers,
s
For something so simple it worked just fine.

I did however do some testing before I saw this post. I edited the delayedrun by replacing the welcome1stboot with my own and that worked as well.

Posted: Sat 31 Aug 2013, 21:52
by oldyeller
Hi RSH,

I did try your as well, but it would start my script even after restarting x-server which is something I don't want to happen. Maybe it is the code

Code: Select all

#!/bin/sh 
BNameOfProg="welcome1stboot"
DontRun="true"
while [ "$DontRun" = "true" ];
do
   if [ "`pidof "'$BNameOfProg'"`" != "" ]; then
      echo "'$BNameOfProg' is still running"
      sleep 1
      else
      echo "'$BNameOfProg' has been exited"
      DontRun="false"
   fi
done 

/usr/sbin/welcome

exit
This could be the problem.

Posted: Sun 01 Sep 2013, 07:56
by oldyeller
Hello Everyone,

I just wanted to say Thanks very much for your help :D :D :D

I got it to work!!!! Thanks again

Cheers

Posted: Mon 02 Sep 2013, 02:58
by technosaurus
FYI, Puppy does this in a non-standard way and not in accordance with:
http://standards.freedesktop.org/autost ... atest.html

Since puppy is single user (root), these should all be in:
/etc/xdg/autostart/

and for a multiuser system they should be in:
$HOME/.config/autostart/

For better portability in future Pups I would recommend using these (maybe submit a woof patch to Barry) and making $HOME/Startup a symlink to $HOME/.config/autostart.