Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 12-03-2013, 01:06 PM   #1
LQ Newbie
Registered: Nov 2013
Posts: 4

Rep: Reputation: Disabled
Calling startx from inside the application

I have made an app with xlib and i call it with startx and path of application as its param

startx /home/app/testapp

now, i want to try out to call startx form insdie the app directly instead of calling explicitly so, it will be like when i will the my application, it will call startx with the rest of my application.

I have tried with calling .xinitrxc from code etc but it doesnot seems working.

Any ideas for that to try out?
Old 12-05-2013, 08:17 AM   #2
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,610
Blog Entries: 12

Rep: Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962Reputation: 1962
The reverse of what you're talking about, a thread I posted a few days ago and my trials and tribulations at getting auto-start of X server and my full screen application at system boot: Having Trouble Configuring to Autostart App in Xserver with no Display Manager.

A good reference I ran into for xorg.conf was:, that one helped me a lot.

From what I gathered:

1. startx can be called with some parameters, simple google searches helped me with that, although I did not know you could specify starting an app as an argument to startx, my intentions were to disable the mouse cursor because it is a touch screen application.
2. /usr/lib/X11/xinit/xinitrc - note not a DOT<name> file, just xinitrc, IS run when you load the X server. And it's a shell script, therefore when you put in stuff like:
exec <path>/your-application
It will run your program, that's exactly what I did.
3. If you wish to disable things like power management, screen saver, and screen blanking, that all falls under the xorg.conf file.

I hope some of this helps. I guess I'm confused as to why you want to load the Xserver as part of your application, unless you want the Xserver to load in a special manner or to do so automatically without user intervention, excepting that they run an application.
Old 12-07-2013, 03:42 PM   #3
Registered: Sep 2012
Posts: 169

Rep: Reputation: Disabled
You could certainly setup the environment and then use something from the exec() family of functions or however you start an external process without waiting from the language you are using; before doing any xlib stuff.

I don't recommend this though. I think a far better solution would be a wrapper script. The script can start X, ideally conditionally even based on if its already running and the current user has permission to connect to the X server, and then start your process. There is no law you can't put a shell script in /bin after all.

What specific problem are you trying to solve by having your process parent the X server directly?


startx, xlib, xserver

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
question about calling an array inside of a user defined function? lleb Programming 7 07-26-2013 05:59 AM
calling curl inside .sh file Linux - Newbie 2 06-09-2012 02:02 AM
not calling function inside switch case??? sarathius Programming 2 01-29-2008 10:38 AM
calling startx from cron, no go Plastech Linux - General 2 05-23-2007 08:13 PM
calling a c++ binary inside a perl script Blue_muppet Programming 3 08-28-2004 11:31 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:49 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration