Thursday, January 29, 2015

Launch GUI applications from a 'screen' terminal

I recently got addicted to the linux 'screen' command, which manages multiple sessions nicely. But even running locally, I had problems launching a GUI program from the command line, e.g., I'd like to view a html file by 'firefox index.html &', and it always gave me an error like this:

(process:15413): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Error: no display specified

Google gave answers like 'export DISPLAY=localhost:0.0' and 'export DISPLAY={myhostname}:0.0', but the one that really works is 'export DISPLAY=:0'.

My environment:

Ubuntu 14.04
Screen version 4.02.01 (GNU) 28-Apr-14