Dec 29, 2007

Multiple X-clients in Linux

Before starting note that this is tested in ubuntu (a debian-based distro).

Here i will be assuming that you are familiar with X-system in linux.

Perhaps you know, what you will get when you press F1 to F8 with control and alt key. Well, if you don't know let me just brief it for you. By default, there are six virtual terminals in linux, F1 through F6.By pressing <ctrl> + <shift> + Fx you can switch to corresponding terminal. Next in F7 there is you your desktop manager. If you are reading this from linux, I must say this is where you currently are. In F8 you will see system logs. From F9 - F12 ...? Yes, this is where we will run other instance of desktop manager.

A brief intro about X-system:
In x-system there are two main parts X-server and X-clients. X-server simply communicates your hardware with the x-clients and a desktop manager gives a gui-environment to make the communication between the user and the x-client easier.
For detail goto wiki-page

Okay, Lets kick off:
It's just a single command. Open a terminal and login using any user-account and just enter the following command:

~$ startx -- :1 &

This command starts a new desktop-manager in screen:1 and the '&' symbol simply backgrounds the process.

The desktop manager on which you currently are, is Screen:0 ==> F7 and by issuing :1 as argument you are requesting to start it on Screen:1 ==> F9 (as you know in F8 there is system log)
Note: You might get it in F8 too or even other in other ditros.

Similarly you can start other three x-client from F10-F12 simply by choosing a from screen 2-4. By starting the x-client as user 'xyz' you will be logged in as same user. And remember you cannot start multiple x-clients in same screen.
In some distro you may also get some error or warning if you try to run it as root.


Note: I have tested it in Ubuntu. If you have tested it successfully in other distro then please post it as a comment.

Dec 7, 2007

Shortcuts in Terminal (console)

Must of use face the problem with cutting and pasting in terminal... I know it because i did felt it a few days back too.
I don't know how but it was my luck that that i pressed ctrl+l insted of shift+l. I got amazed when i saw it cleared my console .. OMG it was a short to clear the terminal screen...

Soon after that i tested with each combination and here are the shortcuts that i found working...

ctrl+L = clear the screen
ctrl+W = clear the current word
ctrl+K = clears everything after the current curser position
ctrl+T = swaps last two letters
ctrl+U = cut
ctrl+Y = paste
ctrl+I = autocomplete (similar to pressing tab-key)
ctrl+P = Previous command (similar to pressing up-arrow)
ctrl+A = Move the cursor to the begenning
ctrl+D = same as what DEL-key does
ctrl+H = same as what BACKSPACE-Key does

...

please comment if you have any more...