LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Playing with X (https://www.linuxquestions.org/questions/linux-general-1/playing-with-x-237363/)

el_pajaro! 09-30-2004 11:51 PM

Playing with X
 
I just want to share with everyone what I just learn today. Playing with X could be so fun and you can understand what a Window Managaer, just try this.

You can have multiple graphical consoles with Linux. So try This:

# X :1 &

This is the most basic way to start X graphical server. You would only see a mouse cursor on the window.

Note :1 means that X would open on ctl+alt+f8 terminal. You can use number between 0 - 5, 0 is the default and might be the one you are using now. You can switch between graphical enviroments by just typing: ctrl+alt+f7 or ctrl+alt+f8 up to ctrl+alt+f12. So after typing the next command you woultd have to type ctl+alt+f7 to get back here.

OPENING AN APLICATION

The next command would set de DISPLAY variable to: 1 The :1 means that the gui programs would open on that graphical console. 1 for ctrl+alt+f7 .

# export DISPLAY=:1

Now lets open a simple aplication. (Remeber ctl+alt+f7 to get back here)

# xeyes &

So your computer now have two eyes cool!!! Now lets run a more usefull aplication. How about a console so you can write the commands on your other X server session. So open your favorite session termniat. It might be one of this: (just type one)
# xterm &
# konsoloe &

Note that we use & so you can still type commands on the same terminal.
Now go to the other graphical terminal ctl+alt+f8:

What happend? you now have a terminal, but you can not move it, resize it. That is because you don't have a Window Manager. So try using one. Posible options are:
http://xwinman.org/

I would use metacity
#metacity &

So that is what a Window Manager is. You can move the windows make it bigger or smaller. Now try to open a browser. So you can browse the web in you light weight Desktop. Type your favorite browser:

#firefox &

Try to open a panel, so you can manage your windows easier: (Only if you use XFCE as your desktop)

# xfce4-panel &

If you don't use XFCE try the panel of your desktop enviroment.

Have fun!!!!!!
And learn Linux :study:

darthtux 10-01-2004 03:08 AM

I like you information. Great job :) It's always good when people share what they learn.

I would just like to add:
startx -- :1
will start another normal X session which is accessible with ctrl+alt+F8

el_pajaro! 10-01-2004 10:50 AM

Code:

I like you information. Great job :) It's always good when people share what they learn.
It si great, that is what Linux is about. Helping each other. Now that I know more than before I would like people to learn too.

But I have question for you or for anybody that reads this thread. Is there a way to start a second session of X with an specific resolution. For example I work developing website. I usually work with a resolution if 1024*720. I would like to start a second instance of X so that I can test my websites at 800*600.

Thanks

Ikebo 10-01-2004 02:27 PM

What is the difference between specifying 'X :0 &' and 'X :0.0 &' ? I notice that using 'startx' uses 0.0 rather than 0, is there a significant difference between the two?

As for your question I'm afriad I don't have a very helpful answer besides maybe creating two configuration files that have the different resolutions specifed and writing a script to copy over one or the other and then start the appropriate X session.

el_pajaro! 10-01-2004 02:34 PM

Quote:

What is the difference between specifying 'X :0 &' and 'X :0.0 &' ? I notice that using 'startx' uses 0.0 rather than 0, is there a significant difference between the two?
If you hava a graphic card that only supports one monitor there is no difference. But if your graphic card support more than one monitor you can specify witch monitor with the second number. Ej: X :0.0 would open on the first monitor and X :0.1 would open on the second monitor.

I would think about your recomendation. Thanks

el_pajaro! 10-06-2004 12:00 PM

Start second sesion of X with different resolution
 
I did it with a help of a friend:

Here is the how to:

I had to edit my XF86Config-4 file at /etx/X11/XF86Config. The default config had this two sections:

The screen section that has de different options of resolution and color depth for an X session. This are insede the subsection display. (This is my Mandrake default)
Code:

Section "Screen"
    Identifier "screen1"
    Device "device1"
    Monitor "monitor1"
    DefaultColorDepth 24
   
    Subsection "Display"
        Depth 8
        Virtual 1024 768
    EndSubsection
   
    Subsection "Display"
        Depth 15
        Virtual 1024 768
    EndSubsection
   
    Subsection "Display"
        Depth 16
        Virtual 1024 768
    EndSubsection
   
    Subsection "Display"
        Depth 24
        Virtual 1024 768
    EndSubsection
EndSection

and: The Server Layout section witch is the one that selects the screen to display

Code:

Section "ServerLayout"
    Identifier "layout1"
    InputDevice "Keyboard1" "CoreKeyboard"
    InputDevice "Mouse1" "CorePointer"
    Screen "screen1"
EndSection

So if in a ServerLayout section I had Screen define as "screen1", it would be using the screen section define with the identifer screen.

So to have a diferent layout I had to create a new screen subsection with a different layout and a new ServerLayout. So this is what I add:

Code:

Section "Screen"
        Identifier "web"
        Device "device1"
        Monitor "monitor1"
        DefaultDepth 24       
                Subsection "Display"
                Depth 24
                Modes "800x600"
        EndSubSection
EndSection

and:

Code:

Section "ServerLayout"
        Identifier        "web"
        Screen                "web"
        InputDevice        "Keyboard1" "CoreKeyboard"
        InputDevice        "Mouse1" "CorePointer"
EndSection

Note that I name the ServerLayout with and Identifier "web". The Screen is also set to "web" because the Screen section has an identifier web. The name web is the name I choose because I would use it to test websites. You can have any name you want. The only important thing is that Screen name in the ServerLayout Section is equal to the Screen Identifier in the Screen Section.
So now we are ready to start a new X session with a 800x600 resolution
Code:

X :1 -layout web
or
Code:

startx -- :1 -layout web
Note that we use web as a layout. That is because the ServerLayout section has the identifier set to web.

Hope this is helpful for someone else.

Greetings


All times are GMT -5. The time now is 06:34 AM.