LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   [trick] Leave console free for apps while running X (http://www.linuxquestions.org/questions/slackware-14/%5Btrick%5D-leave-console-free-for-apps-while-running-x-20418/)

vfs 05-07-2002 03:11 PM

[trick] Leave console free for apps while running X
 
This is good:

startx &

Now you have a free console.

Better:

startx &> /dev/null &

No messages.

Now you can switch console/X session pressing Ctl+Alt+[1-6] and Ctl+Alt+[7<]

Cheers!

vfs.:Pengy:

trickykid 05-07-2002 03:34 PM

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 ? :D

vfs 05-07-2002 03:56 PM

Uh, tried to fool me?:D

Just type in:

jobs

look which number is 'startx' then:

fg number

Ta-da!

Try this too:

startx

Now press Ctrl+Z and startx is in the background, leaving the console free...

regards,

vfs.

acid_kewpie 05-07-2002 04:05 PM

well.. the fool worked.. ehh trickykid?

we do know all of these "tips" btw.

vfs 05-07-2002 04:15 PM

Ok, I just posted because YOU and YOUR friends must know EVERYTHING about Slackware, but there are lots of newbies in this forum.

I posted for THEM, NOT exactly for YOU, ok?

vfs.

acid_kewpie 05-07-2002 04:31 PM

well they are not specific to slackware at all. i'd recommend similar posts go in the "linux - general" forum.

vfs 05-07-2002 04:33 PM

Hum... Ok.

Sorry the screams...

vfs.

theguide 05-08-2002 10:21 AM

Quote:

Originally posted by vfs
........

Try this too:

startx

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 :)

Rashkae 05-08-2002 01:38 PM

Bringing X Back to Forground
 
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.)

acid_kewpie 05-08-2002 06:32 PM

well, no particular reason i can think of, maybe you need to ctrl+c it..

vfs 05-09-2002 09:01 AM

To theguide:

I think so...

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'.

vfs.

acid_kewpie 05-09-2002 09:06 AM

well yeah a kill -9 or something would be easier... just a potential reason.

SiliconBadger 05-09-2002 10:54 AM

You have no chance to survive, make your time!
 
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...

Rashkae 05-09-2002 11:11 AM

> /dev/null
 
/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.

startx > /dev/null &

acid_kewpie 05-09-2002 11:46 AM

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.


All times are GMT -5. The time now is 10:17 PM.