Program that Starts other programs
Posted
#1
(In Topic #936)
Enthusiast

Just wanted to run this idea past your Gambas Experts
what I want to do is have a Small Start up app that load when Linux boots and it will wait for 30 seconds (so Linux can establish network etc) and then it will start
The Program basically would load a list of what to start and then it would start
For example
Start EpsonModule.gambas and moves on (Printer Module for the EPson TM-88 Range)
start EpsonDMModule.gambas and moves on (Customer display from Epson)
Start DataSync with the /update and wait for the app to complete (it would then exit)
Start DataSync with the /rts and move on
Start NPoS (retail softyware) and then exit StartApp
I had one for Windows i just wondered if it could be done on Linux
Posted
Guru

<IMG src="https://www.cogier.com/gambas/Startup.png">
</IMG>
Posted
Enthusiast

cogier said
I am running Linux Mint 21 with the Cinnamon desktop. It has "Startup applications" menu. Here you can see my music player that will wait for 15 seconds before starting. I expect other distros have something similar. Does this help?
<IMG src="https://www.cogier.com/gambas/Startup.png"></IMG>
I'm on Debian 11 and yes it has something like that but I want to be able to send Commands and wait for applciations to load and exit before carrying on
It would be the Linux version of the PoSStart App I have for my Windows versions it boots when Explorer starts and helps to lock down the PoS Terminal
Posted
Regular

Posted
Enthusiast

For example when my system first boots the DataSync app does a full download from the back office (this can take anything from 5mins to 30mins depending on the size of the database) once that has downloaded the app quits and then I need to restart it in real-time sync mode ( DataSync /rts)
Can the start up function of the GUI do that? Or do I need to have my own app to do that (like I've been planning)
Also is it possible to close everything down when the desktop has fully loaded? (In windows I just had to close the explorer.exe and I then had nothing else running just my PoS application)
Posted
Regular

In your "startup" project try using
Code
Shell <cmd+args> WAIT
e.g.
Shell "xfce4-terminal -e 'ls -l' -H" Wait
b
Posted
Enthusiast

SHELL "./algPoS/DataSync/DataSync.Gambas /Firstboot" WAIT
SHELL "./algPoS/DataSync/DataSync.Gambas /rts" &
Posted
Regular

As in, invoke your local terminal emulator with a command to execute and a "hold" so you can see what happens. That is what I have there:
Shell "xfce4-terminal -e 'ls -l' -H" Wait
xfce4-terminal is my local terminal emulator
-e tells it to execute the command "ls -l" which is fairly generic so you can test this on your hardstuff
-H is specific to xfce4-terminal, so you need to research your specific situation.
and, yes the Wait tells the gambas runtime to wait till the command has finished,
SO, for you, maybe Shell "numpy-term –runcommand path to /DataSync.gambas -args" Wait
notes:
- path to : DONT use relative pathing! It wont work as you expect outside the IDE
- understand the difference between an argument and an option. Arguments are usually numbers or else quoted according to what your shell needs. A shell only understands numbers and strings, not paths nor dates nor anything else. Options are a different kettle of fish, they start (usually) with – or - and have lots of ramifications. See the help on the Args component.
I think that's all :?
b
[Mod] No, there's one more!
Unlike another operating system, Linux is case sensitive. That's why I said /DataSync.gambas in bold above.
Posted
Enthusiast

1 guest and 0 members have just viewed this.


