How to set X11 DISPLAY variable for an operation in program?
*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to set X11 DISPLAY variable for an operation in program?
This is the output I get when I start Frostwire ( p2p program );
Code:
pcbsd# frostwire
java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:159)
at java.awt.Window.<init>(Window.java:317)
at java.awt.Frame.<init>(Frame.java:419)
at java.awt.Frame.<init>(Frame.java:384)
at com.limegroup.gnutella.gui.AWTSplashWindow.splash(AWTSplashWindow.java:150)
at com.limegroup.gnutella.gui.Main.showInitialSplash(Main.java:71)
at com.limegroup.gnutella.gui.Main.main(Main.java:39)
pcbsd#
Last edited by alan_ri; 06-16-2009 at 03:29 AM.
Reason: wrapping code tags
You can put a definition before the command like:
DISPLAY=host:0.0 frostwire
For example, suppose that you ssh'ed into another computer with "ssh -X user@host". The DISPLAY variable should be ':10.0' which gets tunneled through ssh. If you had another session open on that host on display 'localhost:0.0', you could enter "DISPLAY=10.0 konsole &". The konsole program would pop up on the remote host.
You might want to investigate why the DISPLAY isn't variable set. How are you logged in?
I've run it as normal user ( thanks Matir ). It showed up, but it did not want to connect. Then I've changed the listening port, it connected. Then when I wanted to shut it down it restarted my PC.
Second time, when I've clicked on it, it just went to tray and KSysGuard doesn't list it in the process table.
What is going on here?
Last edited by alan_ri; 08-12-2009 at 10:50 AM.
Reason: fixing my grammar
Right click on the icon in the system tray. There may be a quit context menu item. This is how some programs like Amarok and Ktorrent work as well. If you were downloading the latest disto's dvd via a torrent, you would close the main display after starting the download. The program will continue to operate in the background with an icon displayed in the tray. The program that you call may be a wrapper that calls another program and then quits. The process is a child that may have a different name and a different PID. Look at the output of "ps -u <username>" and see if it shows up there.
Sorry I missed that you were trying to launch it as root in your earlier message.
Third time; It didn't connect even if the listening port was the same as the last time. When I've changed it, it connected. I've tried to shut it down and again it restarted my PC.
I'm new to BSD, just few days trying it out, but this is weird. I did everything I should, I've even updated java with timezone update tracker.
I'm not able to give the output of the ps command at the moment. In the tray there is no quit button,only close, but nothing have happened when I've clicked on it. Why can I see it only as a normal user?
I did the same thing on Linux and there was no problem with X11 DISPLAY variable when I've run it as root. I will try the command you've suggested jschiwal ( DISPLAY=host:0.0 frostwire ) as soon as I can.
Thanks!
[EDIT]
I gave up.
Last edited by alan_ri; 08-12-2009 at 10:53 AM.
Reason: fixing my grammar
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.