|
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 | .Xresources | xrdb | Using xauth |
| vnc | Cygwin/X | X11 security | Xming | |||
| Troubleshooting | Tips | History | 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.
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.
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.
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:
|
|||||||
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
- Tiled workspaces with tabbed frames, as discussed above.
- 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 main binary implements only basic window manager functionality. Additional modules implement extra features and window management policies.
- 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.
- To run those particularly badly behaving programs, Ion also 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.
- It is not a project of the self-proclaimed “free” or open-source software movement, and does not suffer from popular fads among it, such as a totalitarian approach to font blurring and autoconf.
|
Ion3 2 October 2008 Features include:
|
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.
SawfishSawfish 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.
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 calledxlsfonts:xlsfonts | moreThis 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
Configuring The X Window SystemIf you've installed the X Window System in any prefix other than
/usr, become therootuser and update the library linker's cache by adding/usr/X11R6/libto/etc/ld.so.confand running ldconfig.Additionally, while still the
rootuser, ensure/usr/X11R6/binand/usr/X11R6/lib/pkgconfigare added to thePATHandPKG_CONFIG_PATHenvironment variables, respectively. Instructions for doing this are described in the section The Bash Shell Startup Files.Ensure you replace
/usr/X11R6with$XORG_PREFIXin the previous two paragraphs if you did not create the compatibility symlink in the previous step.As the
rootuser create a basic X Window System configuration file with the following commands:For Xorg:
cd ~ && Xorg -configureFor XFree86:
cd ~ && XFree86 -configureThe 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.newfor Xorg, orXF86Config.newfor XFree86.Edit the newly created configuration file to suit your system. The details of the files are located in the
xorg.conf.5xandXF86Config.5xman pages. Some things you may want to do are:
- Section "Files". Change the order of the font paths searched. You may want to put 100dpi fonts ahead of 75dpi fonts if your system normally comes up closer to 100 dots per inch. You may want to remove some font directories completely.
- Section "Module". If you are going to install NVIDIA drivers, remove the "dri" line.
- Sections "InputDevice". You may want to change the keyboard autorepeat rate by adding
Option "Autorepeat" "250 30".- Section "Monitor". Specify the
VertRefreshandHorizSyncvalues if the system does not automatically detect the monitor and its values.- Section "Device". You may want to set some of the options available for your selected video driver. A description of the driver parameters is in the man page for your driver.
- Section "Screen". Add a DefaultDepth statement such as:
DefaultDepth 24. In the SubSection for your default depth, add a modes line such as:Modes "1600x1200" "1280x1024" "1024x768". The first mode listed will normally be the starting resolution.Test the system with one of the following commands:
For Xorg:
X -config ~/xorg.conf.newFor XFree86:
XFree86 -xf86config ~/XF86Config.newYou 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.logor/var/log/XFree86.0.logto see what went wrong.As the
rootuser, 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.confFor XFree86:
install -v -m644 -D ~/XF86Config.new /etc/X11/XF86ConfigAs a convenience, Xorg-7.2 users should populate the
/etc/X11directory with symlinks to various configuration directories that were located in/etc/X11with previous versions of Xorg. This step is not needed for XFree86 users. Execute the following commands as therootuser: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
rootuser, create.xinitrc:cat > ~/.xinitrc << "EOF"# Begin .xinitrc file xterm -g 80x40+0+0 & xclock -g 100x100-0+0 & twmEOFThis 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 FontsThere 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 ProtocolThe core X font protocol finds fonts from the server configuration file (
xorg.conforXF86Config). 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:
fonts.dir- maps font files to font names; updated with mkfontdirfonts.alias- defines aliases (such as "9x18") for existing fontsfonts.scale- lists scalable fonts; updated with mkfontscaleThe 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.scalefiles 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 theXF86configorxorg.conffile by adding it to the "Module" section:Section "Module" ... Load "freetype" ... EndSectionThe 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.aliasfile specifies the correct character set. Users of ISO-8859-Xencodings whereX!= 1 should modify the/usr/lib/X11/fonts/misc/fonts.aliasfile by replacing the "iso8859-1" string with the proper encoding name. This is accomplished by running the following command as therootuser, substituting the proper value for<X>:sed -i 's,iso8859-1\( \|$\),iso8859-<X>\1,g' \ /usr/lib/X11/fonts/{75dpi,100dpi,misc}/fonts.aliasUsers 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/cyrillicdirectory is first in the font search path. Otherwise, the/usr/lib/X11/fonts/misc/fonts.aliasfile will be used.
Xft Font ProtocolXft provides antialiased font rendering through Freetype, and fonts are controlled from the client side using Fontconfig. The default search path is
/usr/share/fontsand~/.fonts. Fontconfig searches directories in its path recursively and maintains a cache of the font characteristics infonts.cache-1files 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
OTFandTTFX 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:
- DejaVu fonts - These fonts are replacements for the Bitstream Vera fonts and provide Latin-based scripts with accents and Cyrillic glyphs. The DejaVu fonts by are not aliased to the generic family names by default, so
/etc/fonts/fonts.confwill have to be edited for it to be recognized by the generic names such as "Sans". This will be described below.- FreeFont - This set of fonts covers nearly every non-CJK character, but is not visually pleasing. Fontconfig will use it as a last resort to substitute generic font family names.
- Microsoft Core fonts - These fonts provide slightly worse Unicode coverage than FreeFont, but are better hinted. Be sure to read the license before using them. These fonts are listed in the
/etc/fonts/fonts.confaliases by default.- Firefly New Sung font - This font provides Chinese coverage. This font is not listed in the
/etc/fonts/fonts.confaliases by default.- Arphic fonts - A similar set of Chinese fonts to the Firefly New Sung font. These fonts are listed in the
/etc/fonts/fonts.confaliases by default.- Kochi fonts - These provide Japanese characters, and they are listed in the aliases in
/etc/fonts/fonts.confby default.- Baekmuk fonts - These fonts provide Korean coverage, and they are listed in the aliases in
/etc/fonts/fonts.confby default.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
rootuser:install -v -d -m755 /usr/share/fonts/dejavu && install -v -m644 *.ttf /usr/share/fonts/dejavu && fc-cache -v /usr/share/fonts/dejavuSetting up KeyboardsIn 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
XF86Configorxorg.conffile. 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" EndSectionIn 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 XDMxdm 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 -nodaemonIf 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/xdmUsing X ResourcesThere are many options that can be set in X and X clients via resources. Typically resources are set in the
~/.Xresourcesfile.The layout of the
~/.Xresourcesfile consists of a list of specifications in the form ofobject.subobject[.subobject...].attribute: valueComponents 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: whiteglassHowever, you can specify the background for all clients with:
*background: blueMore 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
~/.xinitrcor~/.xsession. To get more information, see the xrdb man page.
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.
This paper provides an introductory look at the X Window System. It is intended to provide the reader with information in two areas:
Anybody who uses a modern Unix based workstation for scientific visualization has almost certainly used programs running under X. While little technical knowledge is required to use today's point-and-click interfaces, a little knowledge about what goes on behind the scenes can make things less imposing and mysterious.
In scientific visualization, like other fields, we are often faced with the age-old decision to ``build or buy.'' To make reasonable decisions, we must have a realistic idea of the amount of time required to ``build'' a portable, graphical program.
Hopefully, this paper will provide readers with a starting point for this understanding, and make them go back and re-examine existing software packages should they get the urge to write a custom X11 based program.
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...).
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:
- Infinite-sized desktop with keyboard panning (and zooming!!)
- Ability to create new desktops on the fly
- 'Lock' certain windows, so they won't be moved or resized during zooming or panning.
- Move/resize/close individual windows with key bindings
- Detect when windows are created/destroyed/moved/resized, and take action
- For instance, detect certain applications, and move/resize them when launched
- Set timers, to take actions once or repeatedly (one of the examples has a function called 'hallucinate' which randomly moves/resizes all the windows on the screen).
- Turn window borders and titlebars on and off
- Dock unrelated application windows together. Or, if one application is started, launch another one automatically
- Diaplay a different wallpaper when each given window is activated (would you really want this???)
- Have a different set of key bindings for each active window
- In addition to this, I'm currently working on an (FLTK-based) API to allow you to create 'in-window-manager' windows, so you can very easily build your own applets.
(Also, I'm hoping at some time to incorporate joystick-driven zoom/pan (anyone wanna volunteer?)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.
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.
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.
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
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.
- When we try to run an X11 application, it reads the $DISPLAY variable, connects to the X11 server (local host, in this case) and provides the magic cookie by reading
~/.Xauthority- Fixed it by deleting
~/.Xauthorityfile (that's not a proper way, of course)
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
xlib: connection to ":0.0" refused by server xlib: client is not authorized to connect to server error: can't open display :0.0
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:
- The "select->middle click" clipboard
- 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
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.
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).
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.
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 + F6That'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 + F7Something unexpected happened and I want to shut down my X server.
Just press:Ctrl + Alt + Backspace
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) |
Unfortunately, this particular baby's grown into an immense, slimy, tentacled beast that's strangling the development of graphical technology on Unix. |
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.
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
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.
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.
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.
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.
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 31, 2009