how to run gtk app on linux without an x server

2

1

backstory - i need to run an adobe air app, which does some things and takes a screenshot of itself and saves out a JPG, then kills itself. (on linux environment)

I have it successfully running on ubuntu in gnome environment. (on EC2, using NoMachine / NXClient remote windowing app)

But what i need, is to run it automated from a script. on the server. When I try running it from commandline (over ssh), i get the error:

Gtk-WARNING **: cannot open display: 

So, my question is, How can this be run automated from a script.

timh

Posted 2013-07-27T17:14:13.960

Reputation: 144

GTK is reliant on X, you'd probably need to make some tweaks and use GTKfb (i.e. GTK Framebuffer) or find a virtual x framebuffer see here for that.

– nerdwaller – 2013-07-27T17:17:58.110

Answers

1

figured it out.

Xvfb :1 &
export DISPLAY=:1
./runMyApp &

timh

Posted 2013-07-27T17:14:13.960

Reputation: 144

0

Even simpler:

$ xvfb-run ./runMyApp

(You'll find the xvfb-run utility in the xvfb package.)

Ferenc Wágner

Posted 2013-07-27T17:14:13.960

Reputation: 111