Softpanorama

May the source be with you, but remember the KISS principle ;-)
Contents Bulletin Scripting in shell and Perl Network troubleshooting History Humor

X Window System

News Recommended Links Architecture Configuration X display manager XDMCP
Exporting_display "Can't open display" Error .Xresources How to Install XRDP daemon on Centos or RHEL Using xauth Xdefaults
Fonts in X X11 security Xming Cygwin/X vnc vino
Installing X11 and Gnome Desktop in RHEL Activating the gnome VNC vino-server from the command line Diagnosing problems with remote X11 sessions via SSH How to Install XRDP daemon on Centos or RHEL Too high refresh rate/ too high resolution problem  
Troubleshooting The Unix Hater’s Handbook Sysadmin Horror Stories Tips Humor Etc

The X Window System. The Athena project at MIT was a joint effort between that university and Digital Equipment to create a graphical interface for Unix, which was finally released in April of 1994. The current version of X, which is now the standard graphical interface for Unix, is Version 11, Release 6. X Windows, often called ``X'', is also known as X11R6 (pronounced ``ex eleven, are 6''). X Windows is the generic name for that overall program that interfaces the graphical software environment with your system's hardware.

The X Window system consists of three main parts - the X server, the window manager and the clients.

  1. The X Server. The ubiquitous XFree86 is a free version that is quite good in its own right. It is distributed under the GNU public license. Most all Linux distributions come with XFree86.
     

  2. The Window Manager. The window manager governs the actual look and feel of your X Windows graphical environment. The hardware and system needs of the graphical environment are handled by the X Server, but the actual appearance and behavior are handled by the humble window manager.

    There are many different window managers which are all designed to run on X11R6. This is because X11R6 is standard and uniform, hopefully, so window managers can be also.  One of the most popular on Linux are Gnome and KDE.
     

  3. X Clients. The graphical environment is useless unless you have software that runs on it. Those individual software programs that run on X Windows are called X Clients. The thing to remember about an X client is that it usually only runs under X Windows. Many programs run under a non-graphical interface as well as X Windows itself, but these use programs use two different resources.

    X clients normally use one of the many graphical toolkits available for X Windows. These are libraries of common pieces of code that different programs may share on an X Windows system. Several such ``toolkits'' exist that are popular among developers, so your X client programs may actually look different in some respects. One program may use "widgets'' (radio buttons, checkboxes, scrollbars, etc) from the Motif libraries, while another program may use Tk libraries, while still another may use X Forms libraries. This is permissible under X Windows, and some client software may even be available for compiling under your choice of graphical libraries.

One of the most interesting feature of X Window System is the ability to export display to other computer over TCP/IP network.  See Exporting_display for details.

In addition to the X server itself, here are a few of the noteworthy utilities:


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

Ion

Ion is a tiling tabbed window manager designed with keyboard users in mind.

So-called "modern desktop environments" converge on total unusability, and present-day mainstream graphical user interfaces in general are far less usable than they are praised to be. Usability simply does not equal low learning curve, and hiding system details from the user, as the Official Truth seems to be these days. Convenience foods are also easy and fast, but not very palatable (and you don't want to know all the ingredients).

Those of us who prefer to use the computer primarily with the keyboard for reasons of efficiency or health, are forgotten when "modern" graphical programs are designed. Mouse-based search-and-click interfaces simply are not efficient except for some very specialised tasks and in other cases involve lots of tedious repetitive clicking and searching. While most widget-based GUIs provide keyboard shortcuts to some operations, these are often sub-optimal – for example, commands can often be superior to cryptic shortcuts – and the general application design still makes them difficult to use from the keyboard. For example, tabbing through dialog entries is difficult if the dialog is laid out in a complex fashion. Most command line and other text mode programs are simply much more usable once you get used to them, but are limited in their output capabilities.

Summary of Ion features

Ion3 2 October 2008

Features include:

  • Tiled workspaces with tabbed frames
  • Designed to be primarily used from the keyboard
  • Fully documented configuration and scripting interface on top of the lightweight Lua extension language
  • Modular design
  • The query module implements a line editor similar to mini buffers in many text editors. It is used to implement many different queries with tab-completion support: show manual page, run program, open SSH session, view file, goto named client window or workspace, etc. Menus are also displayed as queries
  • A statusbar that adapts to the tilings, taking only the space it really needs, modulo constraints of the layout. The statusbar can also be configured to swallow other (small) windows, and does so automatically for Window Maker protocol dockapps, and KDE-protocol system tray icons
  • Full screen client windows are seen as workspaces on their own. It is possible to switch to a normal workspace while keeping several client windows in full screen state and also switch clients that do not themselves support full screen mode to this state
  • The scratchpad module provides a conveniently toggleable area for random tasks, akin to the consoles of many FPS games
  • Supports floating windows of the PWM flavour. These can be had as separate workspaces without an underlying tiling, or floating on top of a tiling. Tiled windows can be detached to float, and reattached

[Aug 4, 2008] TECH SOURCE FROM BOHOL 20 Most ble and S Managers for Linux

JWM
JWM (Joe's Window Manager) is a window manager for the X Window System written by Joe Wingbermuehle. JWM is written in C and uses only Xlib at a minimum. Support for the following can be added as compile-time options:

* PNG and/or XPM icons
* Xft
* Xinerama
* FriBidi
* The Shape extension

JWM is the default window manager used in Damn Small Linux, System Rescue CD, most versions of Puppy Linux, and the ultra-lightweight distribution Slitaz.

Sawfish

Sawfish is a window manager for the X Window System. Formerly known as Sawmill, the name was changed because another software program had the same name (a commercial web log analysis program). Distinctively, Sawfish uses a Lisp-like scripting language, rep, for all of its code, making it particularly easy to extend. For example, it can incorporate keybindings for XMMS.

Sawfish does not come with a panel and was used with the GNOME desktop environment until it was replaced by Metacity in GNOME 2.2.

Scwm
Scwm or Scheme Constraints Window Manager is a window manager for the X Window System. Its main features are dynamic configurability and programmability via a language based on GNU Guile and the embedded arithmetic Cassowary constraint solver. Other features include flexible GUI-driven customization and per window decoration settings (per window 'themes'). The primary developers were Greg Badros and Maciej Stachowiak.

dwm
dwm is a minimalist dynamic tiling window manager for X11. It is externally similar to wmii, but internally much simpler. dwm is written purely in C and, for simplicity, lacks any configuration interface besides editing the source code. This is not as inconvenient as it sounds, however: one of the project's guidelines is that the source code will never exceed 2000 lines, and options meant to be user-configurable are all represented by macros and contained in a single header file. According to the author, it is optimized for high resolution laptop and widescreen displays.

ratpoison
ratpoison is a free minimalist window manager for the X Window System primarily written by Shawn Betts. Its user interface and much of its functionality are inspired by the GNU Screen terminal multiplexer. Its name comes from the fact that it lets the user manage windows without using the mouse (rat).

Its intended successor is Stumpwm; ratpoison was growing increasingly large, and Betts decided to largely reimplement its functionality in Common Lisp.

[Feb 25, 2008] Steve's RHCE Study Guide X Window System

X Window System

[Feb 25, 2008] X Window System

The X Window system comes with a huge set of fonts. To see a listing of the fonts available on your system, try a program called xlsfonts:
xlsfonts | more 

This lists out many fonts, such as:

-adobe-courier-bold-r-normal--12-120-75-75-m-70-iso8859-1
-adobe-new century schoolbook-medium-r-normal--34-240-100-100-p-181-iso8859-1
-daewoo-gothic-medium-r-normal--16-120-100-100-c-160-ksc5601.1987-0
-misc-fixed-medium-r-normal--14-130-75-75-c-140-jisx0208.1983-0
lucidasans-bold-14
cursor

[Feb 25, 2008] X Window System Components

Configuring The X Window System

If you've installed the X Window System in any prefix other than /usr, become the root user and update the library linker's cache by adding /usr/X11R6/lib to /etc/ld.so.conf and running ldconfig.

Additionally, while still the root user, ensure /usr/X11R6/bin and /usr/X11R6/lib/pkgconfig are added to the PATH and PKG_CONFIG_PATH environment variables, respectively. Instructions for doing this are described in the section The Bash Shell Startup Files.

Ensure you replace /usr/X11R6 with $XORG_PREFIX in the previous two paragraphs if you did not create the compatibility symlink in the previous step.

As the root user create a basic X Window System configuration file with the following commands:

For Xorg:

cd ~ &&
Xorg -configure

For XFree86:

cd ~ &&
XFree86 -configure

The screen will go black and you may hear some clicking of the monitor. This command will create a file in your home directory, xorg.conf.new for Xorg, or XF86Config.new for XFree86.

Edit the newly created configuration file to suit your system. The details of the files are located in the xorg.conf.5x and XF86Config.5x man pages. Some things you may want to do are:

Test the system with one of the following commands:

For Xorg:

X -config ~/xorg.conf.new

For XFree86:

XFree86 -xf86config ~/XF86Config.new

You will only get a gray background with an X-shaped mouse cursor, but it confirms the system is working. Exit with Control+Alt+Backspace. If the system does not work, take a look at /var/log/Xorg.0.log or /var/log/XFree86.0.log to see what went wrong.

As the root user, create the configuration directory and move the configuration file to the new directory:

For Xorg:

install -v -m644 -D ~/xorg.conf.new /etc/X11/xorg.conf

For XFree86:

install -v -m644 -D ~/XF86Config.new /etc/X11/XF86Config

As a convenience, Xorg-7.2 users should populate the /etc/X11 directory with symlinks to various configuration directories that were located in /etc/X11 with previous versions of Xorg. This step is not needed for XFree86 users. Execute the following commands as the root user:

mkdir $XORG_PREFIX/share/X11/twm &&
ln -svt /etc/X11 \
    $XORG_PREFIX/lib/X11/{fs,lbxproxy,proxymngr,rstart} \
    $XORG_PREFIX/lib/X11/{xdm,xinit,xserver,xsm} \
    $XORG_PREFIX/share/X11/{app-defaults,twm,xkb}

As the root user, create .xinitrc:

cat > ~/.xinitrc << "EOF"
# Begin .xinitrc file
xterm  -g 80x40+0+0   &
xclock -g 100x100-0+0 &
twm
EOF

This provides an initial screen with a small clock that is managed by a simple window manager, Tab Window Manager. For details of twm, see the man page.

... ... ...

Setting up Fonts

There are two font systems in the X Window System. The first is the core X font protocol, and the second is Xft. Toolkits that use the core X font protocol include Xt, Xaw, Motif clones and GTK+-1.2. Toolkits that use Xft include GTK+-2 and Qt and use Fontconfig for control. Both font systems should be configured for proper font coverage in the X Window System.

Core X Font Protocol

The core X font protocol finds fonts from the server configuration file (xorg.conf or XF86Config). If no font paths exist in the configuration file, the server will fall back to an internal hard-coded path. Assuming the prefix for your X installation is /usr/X11R6, the core fonts will reside in subdirectories of /usr/X11R6/lib/X11/fonts. For each directory in the path, the server reads three files:

The core X fonts protocol uses names such as -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso8859-1. These fonts are rendered by the X server without antialiasing. The server itself uses the "cursor" font for painting the mouse cursor, and the protocol specification requires the font "fixed" to be available.

Scalable fonts, such as Type1 and TrueType, are read from fonts.scale files by the server. The core X font system uses the "freetype" module for non-antialiased rendering of these fonts. Ensure that the "freetype" module is loaded in the XF86config or xorg.conf file by adding it to the "Module" section:

Section "Module"
    ...
    Load  "freetype"
    ...
EndSection

The character set used is part of the font name, e.g. "-iso8859-1". It is important that applications which support a non-English interface specify the character set correctly so that the proper glyphs are used. This can be controlled through the X resources, which will be described later.

In some cases, applications rely upon the fonts named "fixed" or something like "9x18". In these cases, it is important that the fonts.alias file specifies the correct character set. Users of ISO-8859-X encodings where X != 1 should modify the /usr/lib/X11/fonts/misc/fonts.alias file by replacing the "iso8859-1" string with the proper encoding name. This is accomplished by running the following command as the root user, substituting the proper value for <X>:

sed -i 's,iso8859-1\( \|$\),iso8859-<X>\1,g' \
    /usr/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.alias

Users of Cyrillic fonts have properly defined aliases in /usr/lib/X11/fonts/cyrillic/fonts.alias. However, this file will not be used unless the /usr/lib/X11/fonts/cyrillic directory is first in the font search path. Otherwise, the /usr/lib/X11/fonts/misc/fonts.alias file will be used.

Xft Font Protocol

Xft provides antialiased font rendering through Freetype, and fonts are controlled from the client side using Fontconfig. The default search path is /usr/share/fonts and ~/.fonts. Fontconfig searches directories in its path recursively and maintains a cache of the font characteristics in fonts.cache-1 files in each directory. If the cache appears to be out of date, it is ignored, and information is (slowly) fetched from the fonts themselves. This cache can be regenerated using the fc-cache command at any time. You can see the list of fonts known by Fontconfig by running the command fc-list.

The X fonts were not installed in a location known to Fontconfig. This prevents Fontconfig from using the poorly rendered Type 1 fonts or the non-scalable bitmapped fonts. Symlinks were created from the OTF and TTF X font directories to /usr/share/fonts/X11-{OTF,TTF}. This allows Fontconfig to use the OpenType and TrueType fonts provided by X (which are scalable and of higher quality).

Fontconfig uses names such as "Monospace 12" to define fonts. Applications generally use generic font names such as "Monospace", "Sans" and "Serif". Fontconfig resolves these names to a font that has all characters that cover the orthography of the language indicated by the locale settings. Knowledge of these font names is included in /etc/fonts/fonts.conf. Fonts that are not listed in this file are still usable by Fontconfig, but they will not be accessible by the generic family names.

Standard scalable fonts that come with X provide very poor Unicode coverage. You may notice in applications that use Xft that some characters appear as a box with four binary digits inside. In this case, a font set with the available glyphs has not been found. Other times, applications that don't use other font families by default and don't accept substitutions from Fontconfig will display blank lines when the default font doesn't cover the orthography of the user's language. This happens, e.g., with Fluxbox in the ru_RU.KOI8-R locale.

In order to provide greater Unicode coverage, it is recommended that you install these fonts:

The list above will not provide complete Unicode coverage. For more information, please visit the Unicode Font Guide.

As an example, consider the installation of the DejaVu fonts. From the unpacked source directory, run the following commands as the root user:

install -v -d -m755 /usr/share/fonts/dejavu &&
install -v -m644 *.ttf /usr/share/fonts/dejavu &&
fc-cache -v /usr/share/fonts/dejavu

Setting up Keyboards

In this version of X, non-Latin keyboard layouts do not include Latin configurations as was previous practice. To set up a keyboard for Latin and non-Latin input, change the XkbLayout keyboard driver option in the InputDevice section of the XF86Config or xorg.conf file. For example:

Section "InputDevice"
    Identifier          "Keyboard0"
    Driver              "kbd"
    Option "XkbModel"   "pc105"
    Option "XkbLayout"  "en_US,ru"
    Option "XkbOptions" "grp:switch,grp:alt_shift_toggle,grp_led:scroll"
EndSection

In this example, you can use the Alt+Shift combination to switch between keyboard layouts and use the Scroll Lock LED to indicate when the second layout is active.

Setting up XDM

xdm provides a graphical logon capability and is normally set up in /etc/inittab. Most of the information you need to customize xdm is found in its man page. To execute xdm during bootup, change the initdefault level to 5 and add the following lines to /etc/inittab:

# Run xdm as a separate service
x:5:respawn:/usr/X11R6/bin/xdm -nodaemon

If Linux-PAM is installed on your system, you should create a PAM entry for xdm by duplicating the login entry using the following command:

cp -v /etc/pam.d/login /etc/pam.d/xdm
Using X Resources

There are many options that can be set in X and X clients via resources. Typically resources are set in the ~/.Xresources file.

The layout of the ~/.Xresources file consists of a list of specifications in the form of

object.subobject[.subobject...].attribute: value

Components of a resource specification are linked together by either tight, represented by a dot (.), or loose, represented by an asterisk (*), bindings. A tight binding indicates that the components on either side of the dot must be directly next to each other as defined in a specific implementation. An asterisk is a wildcard character that means that any number of levels in a defined hierarchy can be between the components. For example, X offers two special cursors: redglass and whiteglass. To use one of these resources, you need to add the following line:

Xcursor.theme: whiteglass

However, you can specify the background for all clients with:

*background: blue

More specific resource variables will override less specific names.

Resource definitions can be found in the man pages for each respective client.

In order to load your resources, the xrdb program must be called with the appropriate parameters. Typically, the first time resources are loaded, you use:

xrdb -load <filename>

To add resources to X's database in memory, use:

xrdb -merge <filename>

The xrdb instruction is usually placed in ~/.xinitrc or ~/.xsession. To get more information, see the xrdb man page.

[Dec 26, 2007] GNOME Terminator 0.6 by Chris Jones

About: Terminator is an application that provides lots of terminals in a single window, saving valuable screen space otherwise wasted on window decorations and not quite being able to fill the screen with terminals.

Changes: This release uses a new gnome-terminal gconf key to find available profiles. A few more hard-coded items have been moved to the settings array (not that it can be overridden yet). Handling of exiting child processes has been fixed to properly track gnome-terminal settings. Ctrl-Tab and Ctrl-Shift-Tab have been added as options for switching terminals. This release no longer uses parent.show_all() when removing/adding a terminal, and instead shows the actual widgets that have been created. This prevents scroll bars from re-appearing after they have been hidden.

X11 Tutorial by Grant Edwards

A tutorial prepared for SciC 8011, Spring 1995

This paper provides an introductory look at the X Window System. It is intended to provide the reader with information in two areas:

[Jun 14, 2007] XBindKeys

xbindkeys, a program that allows you to launch shell commands with your keyboard or your mouse. Some say it is better that Keylaunch.

If you find xbindkeys a little limited or you hack a lot of scheme for it, maybe you can have an interest in this window manager (clfswm).

xbindkeys is a program that allows you to launch shell commands with your keyboard or your mouse under X Window. It links commands to keys or mouse buttons, using a configuration file. It's independant of the window manager and can capture all keyboard keys (ex: Power, Wake...).

[Jun 4, 2007] PYWM - your Python-programmable X Window Manager

PYWM is a small, simple python-programmable X window manager that's packed with features, yet very easy to learn and use. It gives you easy-to-use tools to create your own personal dream desktop. Control Freak Heaven.

Some window managers are mouse heaven and keyboard hell. Other window managers are the other way around. But PYWM aims to be very comfortable to use from either.

At the moment PYWM is a "pythonised" version of the fast and light FLWM window manager, but it migth grow up and lose all the c(++) code.

So What Can I Do With It?

All sorts of stuff, limited only by your imagination. Here's a short (and very incomplete) list:

Why???

I've seen dozens of window managers in my time.

At one extreme are the morbidly obese KDE and Gnome desktops, which can take longer to fire up than Linux itself! One wonders if development of these two projects is funded by manufacturers of memory and hard disks :p

At the other extreme are hard-core 'minimalist' window managers like 'LWM' and 'TWM', which can be very functionality-challenged, or have some annoying quirks. For example, one WM I tried requires you to hold down the ALT key while using the mouse within a window!

On the fringes are 'rodentophobic' window managers like Matchbox, RatPoison, Ion etc. One thinks of certain people (who will go nameless) who take pride in still using ASCII dumb terminals.

On the advanced end of the spectrum is the wonderful LISP-driven 'Sawfish' window manager.

But PyWM is aimed at the middle ground. On one hand, it's easy to set up magickal key bindings to do pretty much what you want. But on the other hand, it's also comfortable and courteous for mouse users. I find myself often switching from mouse/keyboard to straight keyboard, so PyWM is there for me all the way.

And, above all, it's built to support easy customisation in Python, the world's coolest programming language.

[Jun 4, 2007] Does anybody know a programmable window manager

On Tue, 2005-10-04 at 21:13 +0200, Clemens Eisserer wrote:
> Does anybody know a window-manager which is optimized for beeing
> programmable and extendable?
> The only thing I would like to do is to modify the size of a single
> window on an x-server where only this single window is running -
> withought simulating mouse clicks or something similar ;-)

Devil's Pie (http://www.burtonini.com/blog/computers/devilspie) can
manipulate windows when they appear so you can use it to resize the
window. It isn't a window manager so you can use any WM you want.

[Nov 3, 2006] freshmeat.net Project details for Xming by Colin Harrison

About: Xming is a port of the X Window System server to Windows. It shares the same source code base as Cygwin/X, but does not depend on the Cygwin environment or cygwin1.dll. Xming is a fully featured X11 server for Windows that is very simple to install and use.

[Sep 15 2006] BigAdmin - Submitted Tech Tip Redefining Escape Sequences Generated by Function Keys Using xterm by Phillip Wu, September 2006

Often it is necessary to change the escape sequences generated by xterm when 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 xterm as follows where the escape sequences for F1, F2, and F3 have been redefined. Also, start an application called appl.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

Giri Mandalika's scratchpad An Odyssey to Solaris 11 on Solaris Express 17

Unable to launch any application from command line. The following error message appears on the console:

 Xlib: connection to ":0.0" refused by server
 Xlib: Invalid MIT-MAGIC-COOKIE-1 key
 Thu Aug 15 21:29:59 2005 Gtk-WARNING **: cannot open display: :0.0 at (eval 1) line 1.

[Jun 28, 2006] How to get widescreen resolution in Linux

http://blogs.sun.com/roller/page/alanc?entry=x11_forwarding_102

Chris Gerhard wrote a post last week he called "X11 Forwarding 101" on using xauth to grant permissions to your X display when you su to root. I was all ready to write a response about how the complex steps he'd shown could be replaced by a simple, yet secure, command in Solaris 10 [1]:

xhost +si:localuser:root

UNIX Tips and Tricks

Misc FAQs X Windows

Slashdot Dealing with the Unix Copy and Paste Paradigm

Excellent article on the subject (Score:5, Informative)
by toomim (492480) on Wednesday June 02, @05:02PM (#9319134)
You should read this article: http://www.jwz.org/doc/x-cut-and-paste.html [jwz.org].

In a nutshell, there are TWO completely different clipboards implemented in X:

  1. The "select->middle click" clipboard
  2. And the "copy->paste" clipboard

These two clipboards do not affect or interact with each other.

Other OS's (like Windows) only have the second kind. Modern Unix applications (like anything based on GTK, QT, or Mozilla) support both clipboards simultaneously and independently.

Old X Windows applications like XTerm only support the first kind. This is why you can't copy from or paste into an XTerm using C-c and C-v.

So if you are using modern applications, you should always be able to use C-c and C-v. If you have to copy or paste something into an XTerm, you will have to select it and middle-click. The solution is to use a moderm terminal, like gnome-terminal, instead of XTerm.

If you read the article, you'll learn that there are actually three different clipboards in X (one of which is never used), and that Emacs and XEmacs then implement yet another fourth clipboard!

Also see the freedesktop.org reference [freedesktop.org].

Re:Excellent article on the subject (Score:2)
by 0x0d0a (568518) on Wednesday June 02, @06:49PM (#9320210)
(Last Journal: Tuesday May 25, @07:31PM)
Old-style-clipboards in X == drag-and-drop on Windows/Mac OS. It's just easier to use.

New-style-clipboards n X == copy-and-paste on Windows/Mac OS

Emacs's internal clipboard (the "kill ring") really is an artifact of the fact that Emacs can run in an environment that lacks its own copy/paste support (like a VT200, say). Emacs has a very nice clipboard with a huge history that is generally better than that of the normal operating environment.

It's rather ironic that people are now complaining that X doesn't support clipboards persisting past the life of programs -- it actually *did* at one point with cut buffers, but it's kind of inefficient when you're working with a remote windowing environment to immediately dump every cut to the X server.

Missing the real story (Score:3, Insightful)
by rabtech (223758) <russ&boneville,net> on Wednesday June 02, @05:02PM (#9319143)
The real story is why doesn't Linux have a clipboard standard with well-defined interop standards ala OLE/COM?

I can copy text from VS and paste it into Word, in which case it pastes as RTF with colors and formatting. If I paste it into notepad, I get plain text. This is because the clipboard understands high-level text (RTF) and casting that down into standard text. It also allows apps to provide multiple data formats; copying an image can put a JPG, Bitmap, and PNG on the clipboard and the consuming app can select the format it likes best.

Even better would be to support Office-style multiboard functionality where there are 10-12 "slots" on the clipboard and you can cut and paste from each slot at will.

(Ex: in VS, CTRL+SHIFT+V will cycle through each of the last X copied items for pasting, meaning you can go to one spot of code and copy, then another and

Random links

Xsel is a quick hack to give access to the X selection from the command-line. by Ville Herva

You can then copy stuff between stdin/stdout and the X selection buffer. For example, 'echo puppa | xsel -c' makes "puppa" the current X selection. 'xsel -p | less' pastes the current X selection to less.

Changes: This version adds the possibility to select between PRIMARY, SECONDARY, and CLIPBOARD X selection. It adds a --merge action, and incorporates some code cleanups.

Learning to Use X11

The X Window System was specifically designed to allow the graphical output of a program running on one machine to appear on a different machine, possibly one that is physically remote and/or a different make and architecture. In other words, X11 was designed to be a platform-independent, networked graphics framework.

In X11 parlance, the "display" denotes the box on which the graphical output will appear. Interestingly, an individual display is defined by the X11 documentation as having exactly one keyboard and one pointer (i.e., mouse), but potentially multiple CPUs, monitors, etc.

The "screen" corresponds to the actual physical display device; in most cases this will be a monitor. X11 allows for an arbitrary number of screens to be connected to each display. Think of a workstation with two monitors or a departmental server, connected to a larger number of (relatively dumb) X terminals.

Finally, a "window" is a rectangular area of the screen that can be used for input and output. If the rectangular area is not directly associated with a screen, but instead resides in memory, it is referred to as a "pixmap". Pixmaps and windows share the property of being "drawable" and can be used interchangeably in some function calls. It is important to remember that to X11 a window is merely a rectangular area on the screen. As such, it does not include things like titlebars, scrollbars and other GUI elements that we have come to associate with the word window. If these elements are present, they are controlled by a different program called a window manager.

Every GUI-oriented computer ships with a mouse or equivalent. When X11 came about, the development of graphical input devices was still in its infancy. Consequently the X11 documentation always speaks (somewhat bashfully) of a "pointer" (a generic term for mice), trackballs, digitizing tablets or other yet-to-be-invented graphical input devices. A final cause of confusion is the specific usage of the words client and server in X11: a "client" is any application that creates data for graphical output. The "server" is the program that manages the shared resource accessed by all clients, namely the (finite) amount of screen real estate. The unfortunate consequence of this naming convention is that the (X11) client typically executes on the server (machine), while the (X11) server runs on the client (computer).

Linux.com - Mapping Extras Function Keys with XFree 4.0

Use the xev program that omes with every XFree86 distribution to get your key's scancodes. The default install location of this program is in /usr/X11R6/bin/xev. When you run this program you'll be looking at a white window with a black square in the middle. This program is used to record X11 Events such as mouse clicks, keyboard keys, etc.

Now that you have the program running, try pressing one of your keyboard's extra function keys. In the terminal from which you launched xev, the output should be similar to this:

xev output:
----------------------------------------------------------------
KeyPress event, serial 29, synthetic NO, window 0xe00001,
        root 0x4d, subw 0x0, time 3608986670, (524,-135), root:(589,304),
        state 0x0, keycode 223 (keysym 0x0, NoSymbol), same_screen YES,
        XLookupString gives 0 characters:  ""

KeyRelease event, serial 29, synthetic NO, window 0xe00001,
        root 0x4d, subw 0x0, time 3608986842, (524,-135), root:(589,304),
        state 0x0, keycode 223 (keysym 0x0, NoSymbol), same_screen YES,
        XLookupString gives 0 characters:  ""
----------------------------------------------------------------

Notice that we get 2 events, one KeyPress and one KeyRelease.

The Important part of this event output is the "keycode 223 (keysym 0x0, NoSymbol)" line. By looking at this we can tell a few things. First, the key's scancode is 223. Second, there is no keysym or symbol assigned to that key.

What you need to do now is get the scancode for every extra function key on your keyboard. I suggest you pull out a pen and paper for this process because if you move the mouse or do anything else while trying to get the scancode xev will register a bunch of events that we have no interest in. So make sure to only press the key you want to get the scancode for. Also, make sure you note which button the scancode was associated with. As an example, I've included the scancodes I've gathered for my keyboard/

Key                                             Keycode
-------------------------------------------------------
Standby                                         223
Mute                                            160
Volume Down                                     174
Volume Up                                       176
Play/Pause                                      162
Stop                                            164
Prev Track                                      144
Next Track                                      153
Email                                           236
Web Search                                      229
Run                                             230
Web Home                                        178
--------------------------------------------------------

Once Again, this is just an example! Don't use these values because your keyboard will probably be different than mine.

If you get no output from xev while trying to get your keycodes that probably means you can't use your keyboard with XFree86 4.0. Some keyboards might produce weird keycodes that X can't understand.

Giving a Name to your New Keys

Now that you've gathered all your keycodes, we have to give each one a name in order to assign keysums. This is done in the ~/.Xmodmap file. That's /home/username/.Xmodmap. If this file does not exist just create it with your favorite text editor.

You have to put a line for each key in the format "keycode XXX = keyname". I will list the content of of my .Xmodap file as an example.

~/.Xmodmap Content:
-------------------------------------------------------
keycode 223 = LStandby
keycode 160 = LMute
keycode 174 = LVoldown
keycode 176 = LVolup
keycode 162 = LPlaypause
keycode 164 = LStop
keycode 144 = LRew
keycode 153 = LFwd
keycode 236 = LMail
keycode 229 = LFind
keycode 230 = LRun
keycode 178 = LWeb
------------------------------------------------------

The name you give your keys can be whatever you wish, I suggest giving then a descriptive name in order to avoid confusion. The L prefix in my example stands for "Logitech" and is just there for my reference. Name your keys whatever name makes you happy.

Finally Assign Keysysms to the Keys

For the final configuration, we need to assign keysyms to the keys in order to use them with X. This is done in the XKeysymDB file, located in /usr/X11R6/lib/X11/XKeysymDB on a default installation of XFree86 4.0. You must be root to edit this file.

Here's my additional entries in the XKeysymDB file for my keyboard:

-------------------------------------------------------
! (comments start with a "!")
! Logitech iTouch Keyboard
LStandby                :10090000
LWeb                    :10090001
LMail                   :10090002
LFind                   :10090003
LRun                    :10090004
LMute                   :10090005
LVoldown                :10090006
LVolup                  :10090007
LPlaypause              :10090008
LStop                   :10090009
LRew                    :1009000A
LFwd                    :1009000B
------------------------------------------------------

Once done, save that file and restart X. Start xev once again to verify your setup. Now if you follow the instructions in the first step again to get the scancodes of your keys, you'll notice that there is now a keysym and Symbol assigned to your key. If that was successful, you can now assign those keys to shortcuts or to launch programs. This is done differently with every window manager, so I won't go trough the process; check your window manager's documentation on how to assign shortcut keys.

Gateway - 2001-02-23 23:14:28
Unfortunately, my Gateway PC's keyboard sends a series of signals. So when I hit the 'Pause' button at the top I get ctrl-meta1-alt-p or something.

Also, I found jwz's xkeycaps utility to be very useful. Still can't use my keys as I want to, but I did get it to find out what was going on in a much easier fashion than xev...

X already has quite a few... - 2001-02-23 18:03:54
This can done also by using the files in /usr/X11R6/lib/X11/xkb/symbols. For example, the Logitech iTouch is in the inet file. This can be loaded with setxkbmap file section

where file is the file in the above directory, and section is the type of keyboard you have. This will then give you symbols such as XF86Mail, which can the be mapped in the window manager. One problem with this is that KDE 2 doesn't like these.

Another way to do this is using hotkeys (do a search of freshmeat). Along with libosd (find from the hotkeys homepage). This will work independently of the window manager.

Moving Around the Console

So you're new to Linux and wondering how this virtual terminal stuff works. Well you can work in six different terminals at a time. To move around from one to another:

To change to Terminal 1 - Alt + F1 
To change to Terminal 2 - Alt + F2
...
To change to Terminal 6 - Alt + F6
That's cool. But I just did locate on something and a lot of stuff scrolled up. How do I scroll up to see what flew by?
Shift +  PgUp - Scroll Up
Shift +  PgDn - Scroll Down

Note: If you switch away from a console and switch back to it, 
you will lose what has already scrolled by.

If you had X running and wanted to change from X to text based and vice versa

To change to text based from X - Ctrl + Alt + F(n) where n = 1..6

To change to X from text based - Alt + F7

Something unexpected happened and I want to shut down my X server.
Just press:

Ctrl + Alt + Backspace

ADA95 -- specialist in X Windows.

Slashdot Ask Slashdot Configuring Monitors in X

Slashdot X Windows Must Die!

X windows disasater -- written by Don Hopkins

Possible the greatest work of literature ever written about X. Guaranteed to entertain you for several minutes at least. I think he hangs around /. as well. Just get him started on the topic. :)

Really, it's solid stuff. Think about it, instead of having a knee-jerk reaction.

Re:A lovely summary of all that's wrong with X (Score:5, Informative)
by SimHacker
(don@toad.com) on Friday July 14, @01:47PM EDT (#445)
(User #180785 Info) http://www.catalog.com/hopkins
You're wrong about your "Windows-convert/Machophile" accusation. I wrote it long before I learned to program Windows or the Mac. (Or did you really mean Mach?) At the time, I was a disgruntled ex Sun employee. "Slowlaris: So bad I left the company."

Nobody's blaming X itself for the mistakes of its designers. I'm blaming ignorant hypsters like yourself for all the insincere uninformed cheerleading that led to the widespread adoption of X11, in spite of all of its severe technical problems. Stop being such an appologist for bad design and poor execution.

I tried to make constructive criticism in that chapter, comparing it to NeWS's downloadable code and extensible protocols. NeWS was certainly not perfect, but X11 had a lot to learn from it, and people like you still refuse to open your eyes to that fact.

The software we're using today has evolved into a model much closer to NeWS than X11. Web servers are like NeWS clients (the program that runs an application remotely). The web browser is like the NeWS server (the program running on the user's machine), that controls the display. The web server can download html and javascript to the browser, that interacts locally with the user, much in the same way that NeWS clients download PostScript code to the NeWS server.

So before you tell me that NeWS's model of downloadable extensibility sucks and nobody uses it, you should do some research and check out that new craze that everybody's been talking about recently, called the world wide web. If you have never heard of the web, and can't find a book about it in the library or your local book store, just search for "www" on yahoo.

-Don
Home page: http://www.catalog.com/hopkins

No alternative (Score:4, Interesting)
by Kaa
(freedomdotnet!kaa) on Friday July 14, @10:29AM EDT (#29)
(User #21510 Info)
Well, the reason why X Window is so deeply rooted in the UNIX world is that, to quote one of my friends, "There are no fucking attractive alternatives!". I agree that X is a nightmare and should be killed off by a better competitor, but there is no better competitor.

And BTW, X has plenty of problems but user interface inconsistency is not one of them. X is low-level and user interface standards are clearly not in its domain. The fact that, say, a middle mouse click can do anything at all in an X application is not a drawback of X -- it's a side effect of the UNIX world being fragmented, idiosyncratic, and, yes, free to do whatever one wants.

Kaa
Kaa's Law: In any sufficiently large group of people most are idiots.

It IS that bad... (Score:5, Insightful)
by MenTaLguY (mental@rydia.net.nospam) on Friday July 14, @11:01AM EDT (#137)
(User #5483 Info) http://moonbase.rydia.net/mental
Unfortunately, this particular baby's grown into an immense, slimy, tentacled beast that's strangling the development of graphical technology on Unix.

I would like to note that I don't agree with some of the criticisms in the article -- for example, I think the componentization of the Window manager and various other items is generally a Good Thing. X wouldn't have survived as long as it has if something like the 80s-era window managers were part of the standard server.

While X has a lot of good points (network transparency, platform independence, flexibility in window management), those doesn't make up for its defects. It IS possible to design systems with these characteristics that don't have the downsides that X does.

The underlying X protocol is incredibly clean and extensible, but there are now so many (effectively mandatory) extensions that the code required to support them makes the X server software absolutely huge. ICCCM is a nightmare in its own right.

Moreover, many of these extensions/auxiliary protocols (a prime example would be the X font system) were not designed in the same forward-looking manner as the basic X protocol, meaning that it is necessary to replace, rather than enhance them. However, since existing software still relies on the old extensions, it's not possible to drop them -- you end up with even more redundant code bloat.

X doesn't really give you any choice with regard to widget toolkits, either. You're stuck with the one the app was compiled with, or, more often, coded soley against.

With an architecture like Berlin (or a number of others), it's possible replace the widget set in any or all all apps with the one of your choice -- on the fly.

There's also the problem that EVERY primitive operation in X requires the request to be marshalled/demarshalled across process boundaries.

The address space separation (and consequent easy network transparency) between client and server is not a bad thing, IMO, as it helps stability, but I belive the X designers made a fundamental mistake when they cut the client/server boundary at such a low level.

Having to do this sort of low-level chatting across process boundaries really hurts performance.

Architectures like Berlin maintain the client/server separation, but cut down on the performance hit by communicating at a significanty higher level of abstraction. This means a decently-written Berlin app, even if using a chunky protocol like IIOP, would create significantly less IPC traffic (in bytes) than the equivalent X app.

Of course X has DGA. X has shared memory. Unfortunately, those only work locally. If you rely on them, you just shot network transparency. Whoops.

And, there's another problem: instead of writing graphics drivers independent of any one application class or GUI architecture (which means basic kernel support), everyone's been writing drivers directly for the X server. (Thanks, XFree86!)

This means that to even reach a usable stage, every non-X project has to rewrite their own driver suite from scratch (as a rule, X drivers make too many assumptions about X for the code to be readily reusable for other things).

Although we have fbcon now, fbcon is pretty much unaccelerated, and doesn't have that broad a range of hardware coverage. Berlin is still mostly tested on top of X as a result.

If you have to keep X around to run Berlin, or face severely reduced hardware support, then what's the point?

X has been repeatedly marginalizing other graphical efforts this same way. (Who here has heard of Y Windows, for example? How many of you know someone who uses it? What hardware does it support?)

Thankfully, due to GGI, Berlin can run on fbcon and KGI -- if KGI ever becomes more widespread, Berlin might finally be able to break free of X.

It's time we stopped relying on the X server for everything graphical.

It's too late to throw out the bathwater, baby or no. It's outgrown the bathtub and eaten your dog.

It's time to break out the napalm...

...ceterum censeo delendam esse X11. :)

Recommended Links

Softpanorama hot topic of the month

Softpanorama Recommended

Top articles

Sites

X Window System core protocol - Wikipedia, the free encyclopedia

Kenton Lee Technical X Window System and Motif WWW Sites

Tutorials

Individual pages

XFree86 Version 4.1.0: The official page for the current release of the open-source version of the X Window System. At the bottom of the page one finds the complete set of man pages.

X11-Related Links

Xlib Programming Manual by Adrian Nye. Volume 1 of the X Window System Series at O'Reilly. The book is wordy (it needs three chapters and almost 80 pages to cover not much more material than the present article), and the presentation is not always noted for its clarity. Nevertheless, it is probably still the standard introduction to X11 programming.

X Window Applications Programming by Eric F. Johnson and Kevin Reichard. One of the few truly introductory books on X11 programming

FAQs

USENET

Before posting questions to these newsgroups, I recommend that you read the newgroup FAQs.

Note that some of these groups, especially those not in the comp.* hierarchy, may not be universally available. Contact your system administrator for more information.

Papers:

X/Motif/CDE for UNIX/Linux PCs:

X/Motif for Microsoft Windows

Note: an alternative (and usually much cheaper) way to run X on a IBM PC is to run a PC UNIX in place of or in addition to your Microsoft OS. See the previous solution for more information.

General human-computer interaction links (not all X related):

Lists of X-based applications and products:

This web site lists only the basic X products, such as X servers, Motif, and CDE. The following pages have (much) more information on commercial and non-commercial X-based applications and products.

More X-related sites:

Many of these contain more listings of X-related sites. These overlap with this page, but you may find their organization of the material to be useful. See also the FAQs for more X-related links.



Etc

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit exclusivly for research and educational purposes.   If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner. 

ABUSE: IPs or network segments from which we detect a stream of probes might be blocked for no less then 90 days. Multiple types of probes increase this period.  

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least


Copyright © 1996-2016 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. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License.

The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Last modified: September 12, 2017