Twm

From wiki.gp2x.org
TWM
GP2X11.jpg
Download(s) (gp2x11 site)
Developer(s) Orkie Chris ParkyDR
Version N/A
Status Released
Webpage GP2X11 Project

In computing, twm (Tom's Window Manager or Tab Window Manager) is the standard window manager for the X Window System, version X11R4 onwards. twm was created by Tom LaStrange. It is a re-parenting window manager that provides title bars, shaped windows and icon management, and is extensively configurable.

twm was a breakthrough achievement in its time, but has been largely superseded by other window managers and is no longer maintained. Despite being obsolete, it made a strong impact on the development of X window managers. Many others, such as swm (also by LaStrange), vtwm, tvtwm, CTWM, FVWM and their derivatives, were built on its code, while many others used concepts pioneered by it.

[From Wikipedia.]

It was ported by ParkyDR to GP2X11, which was in turn ported by Orkie. It is not included with GP2X11, but can be found at the project website.

Contents

Instructions to Install

First, follow the basic instructions on how to install GP2X11. Then, get the twm and xeyes archives from x11.gp2x.de and extract them to the 'bin' folder in your gp2x11 folder. Modify the Xserver.gpu file to look like the following:

#!/bin/sh
export DISPLAY=localhost:0
/mnt/sd/x11/bin/Xfbdev -ac&
/mnt/sd/x11/bin/twm &
/mnt/sd/x11/bin/xeyes 

[NOTE: I use x11 in the root of the SD card as my install directory. Modify the lines according to your install directory.

Launch this from the gp2x, it should launch xeyes and wait for input. B will bring up a default menu.

NOTE: You cannot close Xeyes, because TWM needs to have something running or else it will exit.

Using a TWMrc file

In order to have a semi-useful system, you need a twm rc, because the default menu is huge and goes off the screen on the gp2x. To fix this, create an empty file in your x11 install directory. Name it twmrc. Add the following to it:

DontMoveOff
NoGrabServer
RestartPreviousState
DecorateTransients
RandomPlacement
NoHighlight
NoTitleFocus

Color
{
    BorderColor "slategrey"
    DefaultBackground "darkgreen"
    DefaultForeground "gray85"
    TitleBackground "darkgreen"
    TitleForeground "gray85"
    MenuBackground "darkgreen"
    MenuForeground "gray85"
    MenuTitleBackground "gray70"
    MenuTitleForeground "darkgreen"
    IconBackground "darkgreen"
    IconForeground "gray85"
    IconBorderColor "gray85"
    IconManagerBackground "darkgreen"
    IconManagerForeground "gray85"
}

Button1 = : root : f.menu "defops"
Button2 = : root : f.menu "windops"
Button3 = : root : f.menu "progs"

#Default Menu
menu "defops"
{
"gp2x11 TWM"	f.title
"Programs"	f.menu "progs"
"Window Ops"	f.menu "windops"
"Credits"	f.menu "creds"
"--"		f.nop
"Exit"		f.quit
}

menu "progs"
{
"Programs"	f.title
"X Eyes"	f.exec "/mnt/sd/x11/bin/xeyes &"

}

menu "windops"
{
"Window Ops"	f.title
"Focus"		f.focus
"Unfocus"	f.unfocus
"Move"		f.move
"Resize"	f.resize
"Kill"		f.destroy
"Delete"	f.delete
"Refresh"	f.refresh
"Restart"	f.restart
}

#credits
menu "creds"
{
"Credits"	f.title
"Xserv ported by Orkie"		f.nop
"Some apps by ParkyDR"		f.nop
"Theme + menu by 486box."	f.nop
"Thanks!"	f.nop
}

This is a fairly standard twm rc file, customized by Chris(486box) for the GP2X's low-resolution screen. Instructions for editing can be found on Google. Now, edit your Xserver.gpu to have

/mnt/sd/x11/bin/twm -f /mnt/sd/x11/twmrc &

instead of

/mnt/sd/x11/bin/twm &

You should now have a working, decent-looking X server with TWM and a gp2x theme. [NOTE: Quitting does not work! Sorry.]

Adding Programs

To add programs to your 'Programs' Menu in TWM, get the prgram you want from the GP2X11 site. Extract it into your 'bin' folder, and add the following to your twmrc file(above).

 
#This is what's already there:
menu "progs"
{
"Programs"	f.title
"X Eyes"	f.exec "/mnt/sd/x11/bin/xeyes &"
#This is what you should add:
"[Program Name]"  f.exec "/mnt/sd/x11/bin/[progname] &

Special Programs

Xterm and xvkbd are special in that they should have some extra configuration in order to look proper.

 
#xvkbd:
"Keyboard" 	f.exec "/mnt/sd/x11/bin/xvkbd -no-keypad &"
#xterm:
"Xterm"		f.exec "/mnt/sd/x11/bin/xterm -geometry 35x5 &"
Personal tools