X windows can be installed on the 5MX. This involves three basic steps: (1) install the relevant *.deb files (*.ipk files are as yet untested), (2) get the Xipaq X server that has been specially configured for the 5MX, and (3) configure a window manager. X windows is a fairly large overgrown package, but the number of applications designed to run under X windows is staggering. Note: The 5MX Xipaq server seems to be available only as a binary; the original patches to the X source code for the 5MX seem to have been lost. If you have information as to the wherabouts of that patch, please post to the OpenPsion mail list.
You will need to have a compactflash with something like 80 MB of free space available for the linux distribution with X windows. After installation, a great deal of disk space can be freed up by the deletion of extraneous fonts, binaries, and other meta data. Without doing any of this clean up, my 96MB linux partition was left with 12MB of free space.
Until the ipkg system gets sorted out, you will also need a distribution based on dpkg.
The following packages and binaries, or their more modern versions, need to be installed: (The *.deb packages can be obtained from the distribution packages site at debian.org. Be sure to arm binaries, not i386 binaries.)
cpp_2.95.4-9_arm.deb libncurses5_5.2.20020112a-5_arm.deb libdps1_4.1.0-14_arm.deb libfreetype6_2.0.9-1_arm.deb libglib1.2_1.2.10-4_arm.deb libutahglx1_0.0-cvs-20010702-3_arm.deb libxaw7_4.1.0-14_arm.deb xfree86-common_4.1.0-14_all.deb xbase-clients_4.1.0-14_arm.deb xlibs_4.1.0-14_arm.deb zlib1g_1.1.4-1_arm.deb xfs_4.1.0-14_arm.deb (optional) xserver-common_4.1.0-14_arm.deb (optional)The X fonts are slightly optional:
xutils_4.1.0-14_arm.deb xfonts-base_4.1.0-14_all.deb xfonts-scalable_4.1.0-14_all.deb xfonts-75dpi_4.1.0-14_all.debBearing in mind the severe memory constraints, X terminal emulators to consider are:
xvt_2.1-14_arm.deb rxvt_2.6.4-3_arm.deb xterm_4.1.0-14_arm.deb (a memory hog)Of these xvt is preferred, because it uses much less memory.
In addition, you will need to download the Xipaq X server from the "Sourceforge downloads" download site from OpenPsion. This tarball contains:
Xipaq Xmodmap
There are several approaches to using the mouse functions. See the section below on Mouse Issues.
You will also need a Window manager for X. Here we will discuss the Blackbox window manager, blackbox_0.62.1-1_arm.deb. The Windowmaker manager might be a little better (see screenshot below), and there are other managers as well.
Install the above *.deb packages, and copy the Xipaq server to /usr/X11R6/bin/X.
Before starting X, first make sure you are in 4bpp by fbset -a 4bpp, and be sure the touch panel device "/dev/tpanel" exists (mknod /dev/tpanel c 10 11). Then execute startx! If you are not in 4bpp, you will get a segmentation fault. You can start X more simply by just exec xinit which will save a little memory (startx is a script, so it keeps a shell open while X is running.)
You can start X up with the screen rotated. Start the xserver with:
Xipaq -screen 640x240@$ROTATIONwhere for values of $ROTATION:
($ROTATION <45)||( $ROTATION>=315) screenrotation = 0° ($ROTATION <135)&&( $ROTATION>=45) screenrotation = 90° ($ROTATION <=225)&&( $ROTATION>=135) screenrotation = 180° ($ROTATION <=315)&&( $ROTATION>=225) screenrotation = 270°A rotation of 90° can improve the useability of some applications as long the required width is less than 240 pixels. [No, setting the resolution to something bigger (like 640x480 or 1280x1024) doesn't do virtual resolution (nor does it increases your screensize)]. You can set up a small script called /usr/bin/X11/Xrot containing the lines:
#!/bin/sh /usr/bin/X11/Xipaq -screen 640x240@90(and chmod 755 Xrot). Then, the rotated X can be started with xinit -- /usr/bin/X11/Xrot.
There are three main configuration files that need to be set up to run the Blackbox Window Manager: (1) .xinitrc, (2) .blackboxrc, and (3) ~/.blackbox/menu. These are discussed in turn.
~/.xinitrc
/msdos/x11/XRmouse & xrdb ~/.Xdefaults #rclock -geometry 60x60-1-1 & xvt -sb -geometry 60x12+5+20 -sl 200 & /usr/bin/blackbox -rc /root/.blackboxrcstartx, in the end, looks to this file to start up the X applications. The above file ends with blackbox until that process terminates (i.e. when you are done with your X session.) The rclock application is commented out as an example of things you can do to conserve memory.
~/.blackboxrc
session.screen0.slit.placement: CenterRight session.screen0.slit.direction: Vertical session.screen0.slit.onTop: False session.screen0.slit.autoHide: False session.screen0.toolbar.onTop: False session.screen0.toolbar.autoHide: False session.screen0.toolbar.placement: TopRight session.screen0.toolbar.widthPercent: 66 session.screen0.workspaces: 2 session.screen0.focusLastWindow: False session.screen0.edgeSnapThreshold: 0 session.screen0.rowPlacementDirection: LeftToRight session.screen0.focusNewWindows: False session.screen0.windowPlacement: RowSmartPlacement session.screen0.focusModel: SloppyFocus session.screen0.workspaceNames: Workspace 1,Workspace 2 session.screen0.strftimeFormat: %I:%M %p session.screen0.colPlacementDirection: TopToBottom session.screen0.fullMaximization: False session.cacheLife: 5 session.colorsPerChannel: 4 session.opaqueMove: False session.imageDither: True session.menuFile: /root/.blackbox/menu session.styleFile: /usr/share/blackbox/styles/Minimal session.autoRaiseDelay: 400 session.cacheMax: 200 session.doubleClickInterval: 250The main elements here are the menu file (discussed next) and the styleFile. The styleFile sets the colors and contrast - the "Mimimal" style seemed to work well for the psion, but you can try other styles.
~/.blackbox/menu
#Blackbox menu file [begin] (Blackbox 0.62.1pre0) [exec] (xvt) {/usr/bin/xvt -sb -geometry 60x12-10-10 -sl 200} [exec] (rxvt) {/usr/bin/rxvt -sb -geometry 60x14-10-10 -sr -sl 200} [exec] (xedit) {xedit -geometry 500x200-5-5 } [exec] (xcalc) {xcalc -geometry 200x200-15-15 } [exec] (rclock) {rclock -geometry 60x60-1-1 } [submenu] (Window Manager) [exec] (Edit Menus) {xedit -geometry 500x200-5-5 ~/.blackbox/menu} [config] (Config Options) [reconfig] (Reconfigure) [restart] (Restart) [submenu] (Styles) {Which Style?} [styles menu] (Blackbox Styles) {/usr/share/blackbox/styles} [end] [end] [exit] (Exit) [end] [end] #end of menu fileIt is obvious how one would go about adding additional applications to the menu. The "style"'s file gives a list of all of the styles that come with the blackbox package (e.g., "Minimal").
Here is a screenshot of the Windowmaker Manager, an alternative manager. Emacs21 is also shown running. This manager has a number of advantages over Blackbox.
Here is a screenshot of the IceWM window manager, another lightweight manager.
It is possible to use the toolbar of the 5MX screen in X windows using a utility call xpsitouch, an LCD toolbar handler. The README file tells the details on implementation. Xpsitouch basically ties clicks on the icons to specific functions that can be defined. These functions can be used to do things such as rotate the pointer click (mouse 1, 2, or 3), or launch specific applications or scripts.
The psion's touch screen has mouse button 1 pressed by default when you touch the screen. If you hold down the Menu key you can move a window by moving the mouse in the window. If mouse button 3 is the default and you hold down the Menu key, the "mouse" can be used to resize a window by moving the mouse anywhere in the window.
You can change the default mouse button manually using xmodmap:
xmodmap -e "pointer = 2 1 3"will change the default button to 2, etc.
Most desktop systems like fluxbox, fvwm, WindowMaker, blackbox include a system for setting up custom keybindings for executing commands. fluxbox includes such a system natively, blackbox requires the bbkeys package. These systems allow one to set up keybindings to do things such as change the default pointer button (what button is executed when the screen is tapped), or adjust volume, or execute a play or record of sound.
The keylaunch package from the X windows section at debian.org can be used to tie custom key strokes to executing arbitrary commands such as those using xmodmap to change the mouse buttons. Start keylaunch & in your .xinitrc file. Set up a file .keylaunchrc that contains:
# Format: # key=...KeyName: Command # # ... No modifier # *.. Shift # .*. Ctrl # ..* Alt key=..*Return: xvt key=.*.1:xmodmap -e "pointer = 1 2 3" key=.*.2:xmodmap -e "pointer = 2 3 1" key=.*.3:xmodmap -e "pointer = 3 1 2"So that
<Ctrl><1> will set the default mouse button to 1,
<Ctrl><2> will set the default mouse button to 2,
<Ctrl><3> will set the default mouse button to 3, and
<Menu><Enter> will launch an xvt terminal.
It might be possible to set up special key strokes to behave as the mouse buttons - the accessX extensions to X apparently allow you to do that. This is the MouseKeys feature. No luck as yet getting this to work. (If you type "Cntrl""Shift""NumLock" on your desktop, you can then use the number keypad to move the mouse around and execute mouse button clicks. The Psion does not have such a number keypad...)
Defunct Tools: xbut, XRmouse
One tool that binds the mouse buttons to key strokes is xbut. It allows you to map key stroke combinations to mouse buttons, using a .xbutrc like:
# Xbut generates mouse clicks from the keyboard # # To see the keycodes, run xev # 66,Shift,1 # Shift+Left 49,Shift,2 # Shift+Down 65,Shift,3 # Shift+RightYou can download a binary for xbut HERE.
The mouse button functions can also be emulated with XRmouse. This nifty tool uses up considerable RAM at the moment, alas. The XRmouse application can be seen in the top left hand corner of the screenshot at the top of this page. XRmouse takes a bit of getting used to, but it works quite well after a time. The binary and source can be downloaded from http://projects.gnome.hu/xrmouse/index.en.html.
To use XRmouse you need the gtk libraries:
libgtk1.2-common_1.2.10-9_all.deb libgtk1.2_1.2.10-9_arm.deb
The .Xmodmap file that works for me is:
keycode 71 = Shift_L keycode 63 = Shift_R keycode 47 = Control_L keycode 55 = Mode_switch keycode 39 = Alt_L clear Lock add Shift = Shift_L add Shift = Shift_R add Control = Control_L add Mod1 = Alt_L add Mod5 = Mode_switch
While all X applications are technically supposed to work on the psion running X, there are three limitations (1) screen size, (2) memory, and (3) disk space. You must choose your applications carefully, given these constraints.
Window Managers As a window manager, Blackbox works well, as does IceWM and WindowMaker.
Terminal Emulators Given the memory limitation, xvt is the probably best terminal emulator, rxvt is a second.
Editors While xedit will work, axe may be a better editor that uses about the same resources, but it is a little buggy. gvim also works, which may be one's best bet. Or a slimmed down version of vi such as nvi. Slim versions of emacs, or emacs clones, are also available.
Web Browser As a browser, try dillo - set the geometry (try 630x220) and other features in the ~/.dillo/dillorc file (a template for which can be copied from /usr/share/doc/dillo).
Calculators xcalc is a fine calculator that comes by default. Calcoo is another calculator that might work. Other calculators seemed problematic.
You can also install octave and gnuplot. Octave is a matlab-compatable (mostly) package. (Install the *.deb file for octave/arm from Debian packages for an uptodate version. An older version octave-2.0.17.tar.gz, available here (1.5 MB tarball), is more lightweight, hence more suitable for the 5MX. Install with "tar xfz octave-2.0.17.tar.gz -C /usr/local"). Install gnuplot to get graphics; put "gnuplot*geometry: 400x200+0+0" in your .Xdefaults file to have the figure size work for the Psion. Here is a screenshot for amusement:
Clocks rclock is a slightly better clock than xclock. It has a interesting options in its .rclock file - see the man pages.
Games xbill is the best game, but the Debian package won't fit entirely on the screen - you can download a binary xbill-2.1-ARM.tgz 50 KB package slightly modified for a smaller screen - start xbill with xbill --size 240. to change the size (240 is the smallest size). Install with tar xfz xbill-2.1-ARM.tgz -C /usr/local/; requires libtif1 and xaw3dg Debian packages. ace_penguin has a nice set of card games of the solitaire variety that work well.
Agenda The "plan" package, under Miscelleneous at the Debian Packages site, is a nice replacement for Psion's Agenda that works well. You can use it to set alarms.
PDF viewers Alas, there are no pdf viewers that work effectively on the 5MX in linux. xpdf would be your best bet. However it is a little too demanding of the 5MX resources. It requires a few MB of space to install the various packages and their dependencies (e.g., the ghostscript fonts).
E-Book readers There seems to be a dearth of e-book readers for linux, and an even greater dearth of e-book readers for openpsion. Possible options are gutenbrowser available from the Software/X11 download at openpsion.org. Also take a look at OpieReader, which might also work. There's a fltk version which should work fine with X installed (plus the fltk library which is nice and small) and is reasonably light-weight. There is also a heavier weight version for QT which works with QPE/Qtopia but the fltk version is probably a better bet for the Psion. The source code for the fltk version is at http://www.timwentford.uklinux.net along with makefiles which will require a bit of work as they currently create a flpda (the pda software on the agenda) as well as a fltk version, plus they use the Agenda cross compiler. The target for the pure fltk version is (IIRC) fltkreader. Someday someone might even compile one of these for openpsion...
Screen shots "xwd > screenshot" will make a file "screenshot" of the window or screen (depending on the options). Xwd is an X Window System window dumping utility. Xwd allows X users to store window images in a specially formatted dump file. This file can then be read by various other X utilities for redisplay, printing, editing, formatting, archiving, image processing, etc. The utility "xwdtopnm" can convert the screenshot to a *.pnm file for editing or viewing "xwdtopnm screenshot > test.pnm".
It is possible to use a serial mouse on the 5MX. But first: it was once rumoured that using such a mouse would burn out the serial chip. However, the serial chip is meant to be the same as on the netBook, a Maxim 78266, which is identical to the Maxim MAX3243-RS chip. And this chip was explicitly designed to support a mouse. But be aware that if you want to use a external mouse, there is a slight danger to your serial chip. I have used a Logitech serial mouse without a problem for a few years now on my netBook, and the same mouse on my 5MX for a short while now without a problem. And no one has ever reported a burnt out serial chip (the rumour originated with the XTM people, the 186 emulator for EPOC).
You will first need a null-modem adapter for the serial port. The 5MX cable is designed to be null-modem by default, so that it can plug directly into the PC. So to use other external devices, such as mouse or GPS receiver, you need a null-modem serial adapter. The netBook HOWTO has more information about this issue. Your local electronics store should carry such null-modem adapters, although these are becoming harder to find as serial ports disappear from the computer landscape.
Then you will need an honest old serial mouse, which are also becoming harder to find. Check your local PC recycling store for a box of used serial mice, or try e-bay.com. A PS/2 mouse with an adapter will probably not work, unless the mouse is explicitly designed to support serial. I have had good luck with Logitech serial mice.
The 5MX Xipaq server does not support a serial mouse, alas. However, the Xfbdev from familiar linux at handhelds.org supports the 5MX framebuffer and a serial mouse. The 5MX touch screen will not be supported with this X server, however. The version to get is xserver-kdrive-fbdev version 6.6.1-11, and you'll also likely need the libxfont0 package. Unpack these with ar -x foo.ipk and copy the two binaries over to the equivalent place on 5MX. Place the Xfbdev binary in /usr/X11R6/bin and make a link from it to X there.
Then you'll need to make a link from /dev/ttyAM1 to /dev/mouse: ln -s /dev/ttyAM1 /dev/mouse; the Xfbdev server looks to /dev/mouse for the mouse by default. Disable any getty you may be running on /dev/ttyAM1. Then, you need to setup the serial port for 1200 baud. For this try, this script:
#!/bin/sh stty -F /dev/ttyAM1 4:0:8e9:0:3:1c:7f:15:4:0:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0Curiously, you may have to run this twice - it might complain about not being able to carry out the instructions the first time. Then, if you plug in the mouse, and execute cat /dev/ttyAM1, you should see a stream of binary characters when the mouse is moved. Alternatively, try using minicom with 1200 baud set.
At this point, with the binary mouse characters verified, you can start X with xinit to see if the mouse works.
You can reset the serial port for 115200 baud with
#!/bin/sh stty -F /dev/ttyAM1 1:0:800018b2:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:2f:0:0:0:0:0:0:0:0:0:0:0:0:0