Running GUI Program in Terminal
Hello,
I need help please? I need to run a GUI program in centos 6.4 terminal. It’s written in QT4. I have installed all the qt4 libraries. When I run the program I’m getting this error App: cannot connect to X server. How do I solve this? Many thanks Sathees |
What desktop are you running?
|
That's the problem. He has no x. No desktop.
|
I have a dumb question. Can a QT4 app run a gui from command line unless there is a X server or some other window manager running?
|
Quote:
Now, if, instead, you meant to ask "How can I run a program that requires a running X-server without a running X-server?" Well, then, I think that the answer should be fairly clear. ;) There are X-server emulators that can run on "pure" terminals, but I don't think that any of them support QT applications. (I haven't researched that point.) |
basically the X-server runs GUI so:
Code:
startx |
If you are running a graphical desktop and you are getting that error, it may be that the application is not authenticated to the satisfaction of the xserver.
As user, in a terminal, issue the command: xhost +localhost. Then try to run the application. Read up on the use of xauth and xhost for more information. |
See a different post on this today. xinit is what you might use.
|
Thanks for all replays.
When I try startx command its opening desktop. What I’m looking for is, I’m trying to build POS (touch screen till) system for my friend. When user turn the till on its have to open POS software automatic in other word the desktop screen have to blank no menus or the panel. I have to manage to auto start the POS program. Any advice and guidance will be grade full. Also can you advice me the best Linux distros for 1GHZ processor? Many thanks Sathees |
Quote:
As for a Distro that runs on a low end system. Debian, Slackware run on low end system with no problem. Both are for more advanced users, but slackware requires deeper depth in knowledge than Debian. I run Debian on a P3 128MB Ram as a File server and it works out great. |
Have you looked at the manual pages? :scratch: man startx, man Xorg, and man Xinit all discuss methods for having a system boot the X-server and then start a specific program. Usually the "specific program" is a desktop management system, but that's not necessary.
You might also want to look at the Xclients files on you system. Here's a Fedora default "general purpose" one, as an example of how it's done: Code:
$ cat /etc/X11/xinit/Xclients
|
Sorry jam1987
Lets keep it simple I wrote a program call Hello World in GUI. When I turn on my computer running centos 6.4 I want to see Hello World program open it self. I don’t want see any of the OS menus or any think in the desktop other than Hello World app open. Many thanks Sathees |
At first, X and a desktop environmenment or window manager are not the same. You can run an X server without running a DE/WM and it seems that this is exactly what you want to do.
This is as easy as putting a file named .xinitrc in the home directory of your user with this line in it: Code:
exec /path/to/your/program |
Hello Friends,
I have managed to do it. * I install minimum desktop * Install qt4 libraries (because the program written in QT4) * Disable auto login in to Desktop (edit /etc/inittab) * Then auto start up program via /etc/rc.local That’s it If any body need more information I’m happy to help because I’m leaner to Many thanks Sathees |
All times are GMT -5. The time now is 12:06 PM. |