Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2017-01

Running an app on boot

10 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Ed Murashie

I wrote a simple Lazarus program that displays a window and a button and did the same thing using Glade which also uses Gtk+.

I am using a Beaglebone Black with the latest stock Debian Jessie image which start a LxQt desktop program after it boots up.

When I run my program in the LxQt window or in a terminal window, it runs fine.

Now I want my Lazarus or Glade/Gtk program to run when I boot and not see the LxQt desktop program.

I have tried using the Crontab with @reboot command method and the create a .service and use systemctl to register and start it.

No matter what I try I get " Gtk-WARNING **: cannot open display: ". This also happen on a Beaglebone Green and happens when I use Wheezy or Jessie.

What am I doing wrong and how can I fix it?

Thanks,

Newbie Ed

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170125/db001204/attachment.html>

Reply by email

zeljko
to Ed Murashie
Ed Murashie wrote 22 lines
I wrote a simple Lazarus program that displays a window and a button and did the same thing using Glade which also uses Gtk+. I am using a Beaglebone Black with the latest stock Debian Jessie image which start a LxQt desktop program after it boots up. When I run my program in the LxQt window or in a terminal window, it runs fine. Now I want my Lazarus or Glade/Gtk program to run when I boot and not see the LxQt desktop program. I have tried using the Crontab with @reboot command method and the create a .service and use systemctl to register and start it. No matter what I try I get “ Gtk-WARNING **: cannot open display: “. This also happen on a Beaglebone Green and happens when I use Wheezy or Jessie. What am I doing wrong and how can I fix it?

You cannot run an X11 application without running X11 server. That's wrong. If you need headless server gui app then you can use xfvb for such purpose , or normally run X11 wm and then run your app there.

zeljko

Reply by email

Paul Breneman
to zeljko
zeljko wrote 27 lines
On 01/25/2017 11:40 AM, Ed Murashie via Lazarus wrote: > I wrote a simple Lazarus program that displays a window and a button and > did the same thing using Glade which also uses Gtk+. > > I am using a Beaglebone Black with the latest stock Debian Jessie image > which start a LxQt desktop program after it boots up. > > When I run my program in the LxQt window or in a terminal window, it > runs fine. > > Now I want my Lazarus or Glade/Gtk program to run when I boot and not > see the LxQt desktop program. > > I have tried using the Crontab with @reboot command method and the > create a .service and use systemctl to register and start it. > > No matter what I try I get “ Gtk-WARNING **: cannot open display: “. > This also happen on a Beaglebone Green and happens when I use Wheezy or > Jessie. > > > > What am I doing wrong and how can I fix it? You cannot run an X11 application without running X11 server. That's wrong. If you need headless server gui app then you can use xfvb for such purpose , or normally run X11 wm and then run your app there.

Or switch to a Raspberry Pi and use https://Ultibo.org ? Maybe Ultibo can be ported later to Beaglebone?

Regards,
Paul
www.ControlPascal.com

Reply by email

Santiago A.
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
On 2017-01-25 13:26, Paul Breneman via Lazarus wrote: > Or switch to a Raspberry Pi and use https://Ultibo.org ? And then you can also use fpGUI Toolkit <wink> to keep things small and “lite” (no large 3rd party libraries required or there dependencies. eg: GTK, Qt etc). Regards, Graeme

fpgui needs a "graphic environment", Windows or X (or Mac?) . Doesn't it?

Saludos Santiago A.

Reply by email

Marc Santhoff
to Ed Murashie: I wrote a simple Lazarus program that displays a window and a button and did the same…
Ed Murashie wrote 17 lines
I wrote a simple Lazarus program that displays a window and a button and did the same thing using Glade which also uses Gtk+. I am using a Beaglebone Black with the latest stock Debian Jessie image which start a LxQt desktop program after it boots up. When I run my program in the LxQt window or in a terminal window, it runs fine. Now I want my Lazarus or Glade/Gtk program to run when I boot and not see the LxQt desktop program. I have tried using the Crontab with @reboot command method and the create a .service and use systemctl to register and start it. No matter what I try I get " Gtk-WARNING **: cannot open display: ". This also happen on a Beaglebone Green and happens when I use Wheezy or Jessie.

That depends on what you want to achive. Ich you want to make a POS like device that is only showing your program and no window manager menu, task launchers or the like you could do:

Edit the file ".xinitrc" in the standard users home directory. There is one line starting with a programm name only, should be sth. like "lxqt" in your case.
Replace that line with the name of your programm to run. Disable any unwanted background programs by commenting them out with a '#' in front or deleteing that line(s).

Before that you should prepare your program to run full screen by setting the size of the main screen to exactly matching the dipslay size, e.g. for a vga display you use 640 for the width and 480 for the hight. You could additionally block each movement of the main window.

That way you have a one program only device. If you end it, X, the gui system, is shut down. There may be other things to watch and handle, maybe you need to make the cursor invisible or force the main window to stay on top. Or you may want to add a "shutdown -ph" or similar directly after your program in ".xinitrc" so the os of the device shuts down if the user end your program.

HTH,
Marc

Reply by email

Marc Santhoff
to Paul Breneman: Or switch to a Raspberry Pi and use https://Ultibo.org ? Maybe Ultibo can be ported…
Paul Breneman wrote 8 lines
On 01/25/2017 08:09 AM, zeljko via Lazarus wrote: > You cannot run an X11 application without running X11 server. That's > wrong. If you need headless server gui app then you can use xfvb for > such purpose , or normally run X11 wm and then run your app there. Or switch to a Raspberry Pi and use https://Ultibo.org ? Maybe Ultibo can be ported later to Beaglebone?

I don't understand. Does Ultibo drive screens, does it have gui capabilities? The web site has many words but not so many explanations I get...

Regards,
Marc

Reply by email

Michael Schnell
to Ed Murashie: I wrote a simple Lazarus program that displays a window and a button and did the same…
Ed Murashie wrote 5 lines
No matter what I try I get “ Gtk-WARNING **: cannot open display: “. This also happen on a Beaglebone What am I doing wrong and how can I fix it?

Do you *want* a GUI ?

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20170130/e498e93d/attachment.html>

Reply by email