|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
| News | Recommended Links | Minitutorial | Architecture | X display manager | XDMCP | Troubleshooting |
| Configuration | Fonts in X | Exporting_display | Xdefaults | Using xauth | ||
| vnc | Cygwin/X | X11 security | Tips | History | Humor | Etc |
Often it is necessary to change the escape sequences generated by
xtermwhen function keys are pressed, in order to match what an application expects. For example, this is very common for Oracle applications. Here's a way to do this.Start
xtermas follows where the escape sequences for F1, F2, and F3 have been redefined. Also, start an application calledappl.sh./usr/openwin/bin/xterm -name appl -xrm \ '/* F1=Exit F2=Clear Record F3=Back Tab */ runlod*VT100.translations: #override\n\ <Key>F1: string(0x1b) string("OS")\n\ <Key>F2: string(0x1b) string("[32~")\n\ <Key>F3: string(0x1b) string("OP") string(0xff09)' \ -e appl.sh
Xwindows on Solaris Tips
Copy and zip your favourite MS fonts from the nearest Windows box, a good start would be Arial, and Verdana, this will improve the look of most websites considerably.
On the Solaris box unzip the fonts into a temporary directory, using the -L switch ensures that the font names are lower case.
#unzip -L arial.zip
in the same directory run#sdtfontadm
This is a GUI tool, so just select the new fonts and click Install, the fonts will be installed in $HOME/fontadm_fonts. Earlier versions of this tool were reported to be unreliable, but the Sol9 version has worked everytime for me.
The X Window System is a client-server windowing system that works independently from an operating system. It was originally developed by Project Athena at MIT and is now owned and didtributed by a non profit organization called the X Consortium Inc.
In the X Windows world, the hardware through which you communicate with your programs (ie. the keyboard, the mouse, screens, ...) is called a display, and is controlled by a piece of software called an X Window Server. To establish communication with a person, a program (called a client) connects itself to this server through some comunication channel.
Client software talks with the server through a predefined set of message formats called the X Window System Protocol. Messages sent by a client are called requests, since they request actions by the server or information from it. Messages sent by the server to its clients are either responses that provide the requested information or feedback on the success or failure of the requested action, or events that tell the client that some event it might be interested in has taken place.
In conclusion, the X Window System is a windowing platform independent of the operating systems on the machines on which it runs. This means that a client program running under UNIX can use an X server running under DOS or some other operating system.
The window manager in X Windows is a special client that provides the set of features that produce the look and feel of the window system. These features include the window layout, the window borders, the way windows are created, how windows are moved, keyboard mappings, color mappings, onscreen menus, and so on. When a client needs to create a new window, the client and the server ask the window manager how this window should be displayed. Since the window manager is just a client, you can replace one window manager with another to change the look and feel of your window system.
Window managers available:
There are more than 20 different window managers for the X Window System. the most commonly used window managers include:
You can customize the menus and actions of your window manager. However, before doing so, you should spend more time using it and you should read the appropriate manual page. You will find directions on customizing the window manager on its manual page.
Your actual work session under the X Window System is controlled by a session script. Under xdm(1), the session script is taken form an executable file called .xsession in your home directory. You make a file executable using the command: chmod +x file.
#!/bin/sh PATH=$PATH:/usr/local/X11R5/bin twm & xmotd -geometry 500x600+5+5 xclock -digital -geometry 215x50-5+5 & xbiff -geometry 90x50-230+5 & xterm -n `hostname` -geometry 80x40+5+375 & exec xterm -n "Login@`hostname`" -geometry +5+5 -ls
I'll explain this line by line:
Now how do I change the default settings of my favorite applications?
Every application or object in the X Window System has an individual name, which may be individually set for each instance of the object, and a class name, which is usually fixed and the same for all objects in the class. This may sound a litte bit confusing so let's look at a specific example: let's say you have an xterm named login. If you only want to modify the resources of your login xterm, then you'll have to use its individual name, login. In the other hand, if you want to modify the resources of all xterms, then you'll need to use the class name, XTerm. The values of resource variables are usually specified in the form:
objectName*resource: value
Let's say we want to enable the scrollbar:
name*resource: value
name: specifies the application name or the name string that restricts the resource assignment to that application or to a component of an application. If this argument is not specified, the resource assignment is globally available to all X applications.
- resource: specifies the X resource.
! ! XTerm resources ! XTerm*scrollBar: On XTerm*saveLines: 500 XTerm*background: black XTerm*foreground: lightskyblue XTerm*borderColor: lightslateblue XTerm*cursorColor: royalblue XTerm*pointerColor: lightslateblue ! ! XClock resources ! XClock*background: royalblue XClock*foreground: linen XClock*analog: False
But how do I find out the resources available for customizing an application?
This could be a tough question. Most of the time, you'll find the necessary information in the application's online manual page. If you don't, then you can try using one the following commands and see what you can find:
Please consult the appropriate online manual page to learn about the usage and syntax of the commands listed above.
As a last resort, you can check the /usr/local/X11R5/lib/X11/app-defaults directory and see if you can find a sample resource file associated with the application you are trying to customize.
Can I change the resources of an application that is already running?
If editres(1) can get the widget tree of the application in question then you are in buisness. If not, then you'll have to quit the application, modify the resources then start the application again.
Editres is a great way to customize xterms. It'll let you change the font, colors, title and then some. Again, to learn how to use editres, please read its online manual page.
Can I set resources using command line options?
Sometimes you might want to start up an application with special resources, or maybe want to override some of the default resources. For these reasons, most X Widnows applications communicate with the shell command line and accept various command line arguments. These options are often listed in the application's online man page.
xterm -xrm 'XTerm*title: Login' -xrm 'XTerm*foreground: lightbluesky'
will start an xterm 80 columns wide by 40 rows long with its lower left corner 5 pixels away from the left and bottom edges of the screen.
will start an xclock 250 pixels wide by 50 pixels long with its upper right corner 5 pixels away form the right and top edges of the screen.
How do I find out which colors are available?
You can use the xcolors application to view the different colors and their colorname. Or you can list the colornames and their RGB values using the showrgb command.
How can I a choose fonts for my applications?
The X Window System offers hundreds of fonts for the display of text in various character sets and styles. You can use the xlsfonts utility to list the fonts available. You can also use xfontsel to display fonts. For more information on these commands, please read their online man pages.
How do I remap the keys on my keyboard?
There are several utilities that help you remap keys on your keyboard. The most popular ones are xmodmap and xkeycaps (basically a graphical front-end to xmodmap). This may sound redundant but to learn more about the usage of these commands, please consult their online man page.
You can create a file with a name like .xmodmaprc that includes all your bindings. Then type xmodmap .xmodmaprc to load your mappings. Here is a sample .xmodmaprc file:
!
! make shift-, be < and shift-. be >
!
keysym comma = comma less
keysym period = period greater
!
! swap Caps_Lock and Control_L
!
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L
How can I change the keyboard or the mouse cursor speed?
Description of common error messages
setenv DISPLAY displayname:0.0
If you don't know your displayname, then you
can type the who am i command and look for something
that looks like name.seas.smu.edu:0.0 in the output.
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Last modified: August 10, 2009