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

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Post Reply
Message
Author
User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

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

#1 Post 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
Last edited by oldyeller on Sun 01 Sep 2013, 07:54, edited 1 time in total.

User avatar
runtt21
Posts: 1649
Joined: Sun 08 Jun 2008, 02:43
Location: BigD Texas
Contact:

#2 Post by runtt21 »

put a script in /root/startup

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#3 Post 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?

Jasper

#4 Post 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

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#5 Post 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.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#6 Post 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 .

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#7 Post 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

User avatar
runtt21
Posts: 1649
Joined: Sun 08 Jun 2008, 02:43
Location: BigD Texas
Contact:

#8 Post by runtt21 »

If you don't mind me asking, what is it you want to run?

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#9 Post 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.

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#10 Post by disciple »

Check if welcome1stboot is a script - if it is you should just edit that.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#11 Post 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.
Puppy Linux Blog - contact me for access

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#12 Post 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

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#13 Post 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)
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#14 Post 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

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#15 Post 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

User avatar
RSH
Posts: 2397
Joined: Mon 05 Sep 2011, 14:21
Location: Germany

#16 Post 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.
[b][url=http://lazy-puppy.weebly.com]LazY Puppy[/url][/b]
[b][url=http://rshs-dna.weebly.com]RSH's DNA[/url][/b]
[url=http://murga-linux.com/puppy/viewtopic.php?t=91422][b]SARA B.[/b][/url]

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#17 Post 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.

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#18 Post 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.

User avatar
oldyeller
Posts: 889
Joined: Tue 15 Nov 2011, 14:26
Location: Alaska

#19 Post 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

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#20 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

Post Reply