[trick] Leave console free for apps while running X
SlackwareThis Forum is for the discussion of Slackware Linux.
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.
yes, if you use the ampersand ( & ) after running a program from the console or command, it runs it in the background.. now do you know how to bring it back ?
Now press Ctrl+Z and startx is in the background, leaving the console free...
eehrm... i think that is not quite correct.
When you press CTRL+Z, startx will not be run in the background. It will be paused (at least the console says 'stopped'). You have to type: 'bg' (background) to unpause startx and to run it in the background. So CTRL+Z is not enough to move your startx into the background.
BTW: if you want to pull startx out of the background, just type 'fg' and it will return to you
The question that begs to be asked is, why would anyone *want* to bring X back to the forground? It's not as though it had any interative feaures. (If I'm wrong about this, someone please enlighten me.)
But, at least in my system, when you 'ps ax' you see X with a '?', quite like a daemon. There's no need of 'bg'. I can even log out and X continues running.
I don't know the X internals, but I think related to the server+client arch...
to acid:
Or maybe it could be easier to 'killall xinit' or 'startx'.
I don't understand the > /dev/null & part of startx &> /dev/null &.
Also, acid_kewpie: why, as a moderator, would you discourage people from posting tips saying, "we do know all of these tips"?... as if everyone who enters this forum already knows all linux tips. I do agree that these particular tips are better posted in the general linux area though. I just don't understand the point of a moderator trying to make people feel dumb for posting something they apparently consider to be elementary. It would stand to reason that a lot of posts on a BBS for questions about a particular topic would involve subjects that the moderators already know in detail. That's one big reason for having moderator status. Anyway...
/dev/null is a special device that goes... absolutely nowhere, the big bit bucket in the sky. (It's also a great device to use for backups. Guaranteed, backups will go many times faster.).
X outputs all kinds of status messages all the time. This can be useful for debugging when something goes wrong, but would make running X in the background almost useless, because the console is getting bombarded with the status messages. > is used to redicred standard output. In this case, we are redirectiong to /dev/null (quietly disposing of all the data.). Alternatively, you can redirect data to a file to keep a log (or for programs that output to STDOUT and you need to capture it)...
> /somedir/somefile.. Note that as well as STDOUT, there is also STDERR where most programs will send error messages. These are redirected independant of STDOUT with 2>.. for example: startx > /dev/null 2> /somedir/error.log
And finally, you only need one & for the whole thing.
of course people are perfectly free to post useful tips and such, but, being a continually changing forum, tips and such always sink without trace within a very short period of time. some point last year one guy took it upon himself to write a series of lengthy FAQ's that were quite good actually, but naturally as VERY few members ever use the search features on the site it dissapeared within a day.
In actual fact in a short while a few extra features are gonna be added to the site for tips and tutorials and stuff that will hang around permanently. I'm sure contributions will be welcome.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.