
My (near) final twm desktop. I promise. Desktop is tiled with a paisley grey pattern to give it a subtle texture and depth, and to make it easier on the eyes over long periods of time. It’s better than a pure black or even a pure gray color. I’m using Saddle Brown and Sienna everywhere else (those are real X11 colors). What follows is my .twmrc file, complete with comments. Yes, it’s old school (how about 20 years old school?). For the full details check the X.org twm(1) man page.
Here’s some of the features I’ve enabled so far:
- Default icons on the title bar are gone now (via NoDefaults). I use my own icons, and now have a close window directly on the title bar.
- The resize icon is now on the far left corner of the titlebar, the kill window on the far right. There’s also a minimize and maximize button now. This makes window control a bit more contemporary.
- The titlebar highlight is gone (NoTitleHighlight)
- The titlebar looks like BeOS window decorations (SqueezeTitle)
- Cursor movement now pops the window up to the top automatically (AutoRaise)
- Borders are much larger and the whole looks a lot like Microsoft’s Windows 8 Metro (BorderWidth 4)
- When you move any window, the contents move as well instead of the nearly invisible outline (OpaqueMove)
- The desktop menus make more sense, especially left mouse button click on the desktop (see screen capture above)
And here’s my .twmrc
## Modified wbeebe 16 February 2014#AutoRaise {"xterm""emacs""medit"}DontMoveOffNoGrabServerRestartPreviousStateDecorateTransientsRandomPlacementTitleFont "10x20"ResizeFont "9x15"MenuFont "10x20"IconFont "10x20"IconManagerFont "9x15"BorderWidth 4MenuBorderWidth 3## Show window contents as you move the window. This does not# have the same effect on resizing.#OpaqueMove## Show the icon manager on the desktop. It's size and location# are defined in .Xresources.#ShowIconManager## Define which desktop applications won't have# title bars. Remember that without a titlebar# you can't easily close it,resize it, or iconize# it.#NoTitle { "oclock"}## Now define which cursor will appear as the the mouse# cursor passes over different parts of the X-window## The cursors are all part of the cursor font and can# be displayed with the command:# xfd -fn cursor## The list of cursor names can be accessed by looking at# /usr/X11R6/include/X11/cursorfont.h on Spiffy# /usr/lpp/X11/include/X11/cursorfont.h on morgana#Cursors{Frame "left_ptr"Title "left_ptr"Icon"left_ptr"Iconmgr "left_ptr"Menu"left_ptr"Button "hand"}## This hand feature moves the cursor into the center of# a window that has been de-iconified.#WarpCursor# Add buttons to a window's titlebars## First, remove the defaults from the window titlebars.# And get rid of the annoying titlebar hightlighting effect.#NoDefaultsNoTitleHighlightTitleButtonBorderWidth 2## I like SqueezeTitle. The titlebar only occupies as much space as needed.# Reminds me of BeOS.# If you want to have standard titlebars, remove or comment out this line.#SqueezeTitle## Now add our buttons.#LeftTitleButton "~/twm/icons/resize.xbm" = f.resize## Note that declarations are from left to right in the order they'll# be displayed on the right upper corner.#RightTitleButton"~/twm/icons/minimize.xbm" = f.iconifyRightTitleButton"~/twm/icons/maximize.xbm" = f.fullzoomRightTitleButton"~/twm/icons/close.xbm" = f.deleteColor {# Colors that I've experimented with# 305030 - green# 203020 - darker green - unselected border# 406040 - another greenBorderColor "Sienna"BorderTileBackground "SaddleBrown"BorderTileForeground "SaddleBrown"DefaultBackground "#E6E6E6"DefaultForeground "#000000"TitleBackground "Sienna"TitleForeground "#e6e6e6"MenuTitleBackground "#ff4500"MenuTitleForeground "#e6e6e6"MenuBackground "#C0C0C0"MenuForeground "#414D5B"MenuBorderColor "#ff4500"MenuShadowColor "Gray"IconBackground"Firebrick"IconForeground"White"IconBorderColor "Firebrick"IconManagerBackground "Sienna"IconManagerForeground "#e6e6e6"IconManagerGeometry "=300x250-0+0"}## Define some useful functions for motion-based actions.#MoveDelta 3Function "move-or-lower" { f.move f.deltastop f.lower }Function "move-or-raise" { f.move f.deltastop f.raise }Function "move-or-iconify" { f.move f.deltastop f.iconify }## Mouse button bindings. Button 1 is the left button,# Button 3 is the right mouse button.#Button1 = : root : f.menu "applications"Button3 = : root : f.menu "desktop_ops"Button1 = m : window|icon : f.fuction "move-or-lower"Button3 = m : window|icon : f.function "move-or-raise"Button1 = : title : f.function "move-or-raise"Button3 = : title : f.raiselowerButton1 = : icon : f.function "move-or-iconify"Button3 = : icon : f.iconifyButton1 = : iconmgr : f.iconifyButton3 = : iconmgr : f.iconify## Desktop Operations menu#menu "desktop_ops" {"TWM Functions"f.title"Force Move"f.forcemove"Raise" f.raise"Lower" f.lower"Zoom" f.zoom"Full Zoom" f.fullzoom"Identify" f.identify"" f.nop"Kill" f.destroy"" f.nop"Swap Screen" f.warptoscreen "next""Focus" f.focus"Unfocus" f.unfocus"" f.nop"Refresh" f.refresh"Restart" f.restart"Read twmrc"f.twmrc"Version" f.version"" f.nop"Exit" f.quit}## Application menu#menu "applications" {"Applications" f.title"Terminal"!"xterm &""MEdit" !"medit &""Xload" !"xload &""Oclock"!"oclock &""Xlogo" !"xlogo &""Xeyes" !"xeyes &""" f.nop"Show Icon Manager" f.showiconmgr"Hide Icon Manager" f.hideiconmgr"" f.nop"Raise" f.raise"Lower" f.lower"Iconify" f.iconify"Resize"f.resize"Move" f.move"Delete"f.delete"" f.nop"Exit" f.quit}
My .Xresources file:
XTerm*local: trueXTerm*foreground: whiteXTerm*background: blackXTerm*font: 9x15XTerm*scrollBar: trueXTerm*rightScrollBar: true!XLogo*geometry: 150x150!oclock*geometry: 150x150-0-0oclock*background: Gold!XEyes*geometry: 250x135!XLoad*geometry: 250x140XLoad*foreground: whiteXLoad*background: black
And my .xinitrc file:
#!/bin/shuserresources=$HOME/.Xresourcesusermodmap=$HOME/.Xmodmapsysresources=/etc/X11/xinit/.Xresourcessysmodmap=/etc/X11/xinit/.Xmodmap# merge in defaults and keymapsif [ -f $sysresources ]; thenxrdb -merge $sysresourcesfiif [ -f $sysmodmap ]; thenxmodmap $sysmodmapfiif [ -f "$userresources" ]; thenxrdb -merge "$userresources"fiif [ -f "$usermodmap" ]; thenxmodmap "$usermodmap"fi# Look for default system-wide applications to# start. This is left as an historical reference.# You should start programs in the local .xinitrc#if [ -d /etc/X11/xinit/xinitrc.d ] ; then for f in /etc/X11/xinit/xinitrc.d/?*.sh ; do [ -x "$f" ] && . "$f" done unset ffi## Set default desktop cursor to arrow instead of 'X'#xsetroot -cursor_name left_ptr## Set the desktop background, either a solid color# or a tiled image.## xsetroot -solid steelblue4 &xv ~/twm/tiles/black_mosaic.jpg -root -quit## Switch off default beeps#xset -b## Start some default applications.#exec xterm -geometry 80x20+0-0 &exec xterm -geometry 80x40+0+0 &exec oclock &## Launch twm. This should be the last thing you do,# and it should be execed. This allows f.quit in# the TWM menus to work, instead of using something# crude like 'pkill x'#exec twm
I have not included my icons directory or their files. I’ll probably check all those into Sourceforge along with the images in the near future. But I have reached a point of diminished returns. It works and looks pretty much the way I want, and is reasonably fast, much faster than a contemporary desktop environment.
You must be logged in to post a comment.