Stonemind WEB Toward Less Mousing

Toward Less Mousing

my motivation

I read with interest the blog post Going commando – put down the mouse and the comments people made, which introduced a few new keyboard shortcuts I was not aware of as well as some software that was new to me. The most interesting link I followed was for Ion, an alternate window manager that requires less mousing. Its small, efficient, customizable and very usable.

(Note that the instructions I give below are fairly Ubuntu specific in places, but I will try to point those out.)

Playing with Ion has been fun, but I also have a very practical goal in mind. Recently, I purchased a laptop that, after rebates, was just over $300! It was obviously low end, and probably being sold so cheaply because Vista was due out soon and would probably not run well on such a machine, if at all. Of course, Linux works on it just fine. (Its a Compaq Presario v3000Z AMD Mobile Sempron 3400+, 512Mb RAM, 40Gb hard drive, 14 inch screen and wireless card. I immediately installed Ubuntu on it.) I had a hard time getting the wireless card to work, but eventually overcame that hurdle. Sleeping/hibernating/etc is not great, but that’s still a rough edge with Linux in general, and I learned to work around it. Ubuntu doesn’t always get the time left on the battery charge right either, but the screen is probably the crispest I have ever seen on a laptop, even on a Mac Power Book. All in all, a positive purchase, but making the most of limited resources of the machine is a goal.

One thing that continues to be annoying is the sensitivity of the touchpad. I did find a helpful post for disabling the touchpad while typing, which was a significant help. Still, when I do try to use the touchpad, it sometimes seems to have a mind of its own, jumping around the screen at times, which is very frustrating. (A friend of mine who runs Windows XP on a Compaq reports similar frustrations.)

Another consideration is the general way in which I use the laptop, which is primarily for Web browsing and Web based demos, emailing and writing simple text. This is not too strenuous and the low end laptop handles it fine. In general, whether on the laptop or desktop, I tend to run a small number of applications most of the time:

  • a terminal emulator for ssh and other command line tools,
  • Eclipse,
  • Firefox,
  • a simple text editor like gEdit, or more recently, Scribes.

I will occasionally supplement this with Open Office, Gimp and Rythmbox and a small fraction of the time run other specialized programs for other needs, including administration through various utilities. But generally speaking, I use a small number of developer related tools, and I run them either maximized or occasionally side by side, in a split window style approach.

Enter Ion. Its smaller than Gnome and designed to be used without a mouse, so that maybe I can just turn the mouse off entirely and avoid its frustrations altogether. In fact, I was going to try to script this so that the mouse would be activated in Gnome but not Ion, but the touchpad actually has an on/off button on it so because of that, along with the fact that Ion allows you to use the mouse normally, and there are times when I might want to switch it back on, either in Gnome or in Ion, I decided not to go that route. Finally, Ion itself has some interesting usability features, including a very straightforward and efficient way of managing windows, frames and workspaces as well as key bindings that make common developer actions more convenient.

Want to open a shell? Press F2 and a terminal emulator window opens. Need an ssh session? Press F4, type your server name at the prompt and you’re there. Press F5 to open a file in its associated application and F3 to quickly type in an application to run (it auto completes as you type). And of course, you can create your own key bindings. By default new applications open in maximized windows, but with a simple key command, you can split window views into tiled frames, either way, Ion makes optimal use of screen real estate.

And in the end, the minimalism of Ion appeals to my personal aesthetic, the same way I grew to appreciate Gnome once I switched to Ubuntu.

Ion quick start

First, in Ubuntu, run the synaptic package manager (under System -> Administration -> Synaptic Package Manager in the top left Ubuntu menu) and search for ion3. Select the ‘ion3′ package as well as the ‘ion3-scripts’ package and apply the change.

Although the Ion site says that version 3 is ‘unstable’ I recommend it. It appears to be stable for me, and has a lot more useful features and user contributed scripts.

To get a default Ion session up and running simply create a file called ‘.xsession’ in your home directory with the following content:

#!/bin/shion

Now restart your X session with the CTRL-ALT-BACKSPACE combination, log into Ubuntu as you normally would, and you will be quickly brought into a working Ion session.

You can also add startup programs to this file by putting their commands before the ion call and appending ‘&’ after non-daemon applications to run them in the background. But, make sure you do not tell ion to run in the background. For example, my .xsession file has a few more entries to accommodate disabling the touchpad while typing and to invoke XBindKeys, which I will discuss later:

#!/bin/shsyndaemon -t -dxbindkeysion

configuring ion

Ion is easily configurable through files written in the Lua programming language, although you can probably customize as much as you want without really knowing Lua. But before getting into how to customize Ion, its helpful to orient yourself to where Ion’s files are located in Ubuntu:

  • /usr/lib/ion3, contains the modules that provide Ion’s functionality,
  • /etc/X11/ion3, contains the basic configuration files and styles used in Ion,
  • /usr/share/ion3, contains user contributed scripts, which is where the real fun is,
  • /etc/default/ion3, in Ubuntu, an important configuration file that I will discuss in a moment,
  • ~/.ion3, a place to put your customized Ion configurations.

A typical customization scenario involves copying files from /etc/X11/ion3 to ~/.ion3 and making changes to the copies. When Ion starts, it will look for the files there first.

In Ubuntu, /etc/default/ion3 contains the mod key mapping for Ion, the primary key used to initiate Ion key commands. By default, this is set to mod1, which is typically the left ALT key. However, the ALT key is used in many other program’s key commands, and to avoid a possible collision, I, and many others, map the mod key to mod4, which is typically the otherwise useless “flying Windows” key. To do this, your /etc/default/ion3 file should look like this:

META=”Mod4+”ALTMETA=””

Its possible that this may not work for you, in which case, you may want to consult the ‘Modifier Releases’ entry on the Ion site.

Beyond mod key mapping, the most important file to begin customizing is the cfg_ion.lua file, which is the main file that controls Ion’s behavior, specifying its functionality and what user defined scripts to use. Here is my cgf_ion.lua file based on the stock Ion install file that I copied and modified only slightly:

—- Ion main configuration file—- This file only includes some settings that are rather frequently altered.– The rest of the settings are in cfg_ioncore.lua and individual modules’– configuration files (cfg_modulename.lua).—- Set default modifiers. Alt should usually be mapped to Mod1 on– XFree86-based systems. The flying window keys are probably Mod3– or Mod4; see the output of ‘xmodmap’.–META=”Mod4+”–ALTMETA=””– Debian sets the META and ALTMETA keys in /etc/default/ion3.dopath(“cfg_debian”)– Some basic settingsioncore.set{ — Maximum delay between clicks in milliseconds to be considered a — double click. — dblclick_delay=250, — For keyboard resize, time (in milliseconds) to wait after latest — key press before automatically leaving resize mode (and doing — the resize in case of non-opaque move). –kbresize_delay=1500, — Opaque resize? –opaque_resize=false, — Movement commands warp the pointer to frames instead of just — changing focus. Enabled by default. –warp=true, — Default workspace type. –default_ws_type=”WIonWS”,}– cfg_ioncore contains configuration of the Ion ‘core’dopath(“cfg_ioncore”)ioncore.defshortening(“[^:]+: (.*)(<[0-9]+>)”, “$1$2$|$1$<…$2”)– Load some kludges to make apps behave better.dopath(“cfg_kludges”)– Load some modules. Disable the loading of cfg_modules by commenting out– the corresponding line with — if you don’t want the whole default set– (everything except mod_dock). Then uncomment the lines for the modules– you want.dopath(“cfg_modules”)dopath(“mod_query”)dopath(“mod_menu”)–dopath(“mod_ionws”)–dopath(“mod_floatws”)dopath(“mod_panews”)dopath(“mod_statusbar”)–dopath(“mod_dock”)–dopath(“mod_sp”)dopath(“bookmarks.lua”)–dopath(“cfg_dock.lua”)dopath(“schedule.lua”)– my additions from http://modeemi.fi/~tuomov/repos/ion-scripts-3/dopath(“rss_feed_hh.lua”)dopath(“weather.lua”)– Deprecated.–dopath(“cfg_user”, true)

All of the dopath lines that are commented out (the lines that begin with ‘–’) are lines that gave me errors of some kind, in some cases, just saying they were already loaded. Trying to run Ion with these activated presented the only times I have seen errors or run into problems with Ion so far (I am currently running version 20060524-3). Also, notice the META and ALTMETA settings near the beginning of the file. In systems other than Ubuntu, this is where you would change the mod key mapping. But as I already mentioned, in Ubuntu, changing the settings in cfg_ion.lua will have no effect, they must changed in /etc/default/ion3.

To test configuration changes, simply hit the F12 key and in the bottom status bar prompt, type ’session/restart’ without the quotes, to quickly make your changes take effect. You might also run into a situation, most likely when editing cfg_ion.lua, in which the X server itself will crash or fail to restart because of errors you have introduced. This doesn’t mean you’ve inadvertently locked yourself out of the machine–Gnome is still available. At the Ubuntu login screen, select ‘Select Session’ from the ‘Options’ button at the bottom left of the screen. In the resulting dialog box, choose Gnome, login as you normally would and choose ‘Just For This Session’ from the second dialog box that will pop up. You can now make changes in the normal Gnome environment and quickly get back to Ion with CTRL-ALT-BACKSPACE to restart X. In fact, this is a quick way to switch between the two window managers, and it makes trying Ion risk free, while providing access to both environments when one might be better suited to a task than another. (More on that topic later.)

Finally, you may see font related errors when you try to start Ion that result from a known issue with Ubuntu, and possibly other Debian based distributions, and affect many X applications. In /etc/X11/xorg.conf, you should see a section with this in it:

FontPath “/usr/share/X11/fonts/misc” FontPath “/usr/share/X11/fonts/cyrillic” FontPath “/usr/share/X11/fonts/100dpi/:unscaled” FontPath “/usr/share/X11/fonts/75dpi/:unscaled” FontPath “/usr/share/X11/fonts/Type1” FontPath “/usr/share/X11/fonts/100dpi” FontPath “/usr/share/X11/fonts/75dpi” FontPath “/usr/share/fonts/X11/misc” FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”

However, many of these paths are incorrect, they should say ‘…/fonts/X11/…’ rather than ‘…/X11/fonts/…’:

FontPath “/usr/share/fonts/X11/fonts/misc” FontPath “/usr/share/fonts/X11/cyrillic” FontPath “/usr/share/fonts/X11/100dpi/:unscaled” FontPath “/usr/share/fonts/X11/75dpi/:unscaled” FontPath “/usr/share/fonts/X11/Type1” FontPath “/usr/share/fonts/X11/100dpi” FontPath “/usr/share/fonts/X11/75dpi” FontPath “/usr/share/fonts/X11/misc” FontPath “/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType”

more advanced customizations

Aside from mod key mapping and the customizations to the cfg-ion.lua file, you will probably want to add other custom functionality and customize the status bar to quickly view important pieces of information.

From the Ion3 scripts page, I browsed to the source for each of the following scripts, doing a CTRL-s in Firefox to save each to my ~/.ion3 directory, keeping their original names:

  • rss_feed_hh.lua
  • statusd_laptopstatus.lua
  • statusd_volume.lua
  • weather.lua

Each script has comments at the top that tell you how to activate and configure them. Some, like weather.lua require that they be loaded in cfg_ion.lua, which you can see in the code for that file above. The weather script also requires configuration in cfg_statusbar.lua. Again, copy cfg_statusbar.lua from /etc/X11/ion3 to ~/.ion3, then add your local weather station to mod_statusbar.launch_statusd {. Here is my entry for that sunny tropical paradise, Ithaca New York:

weather={ station=”KITH”, },

I found the code for the weather station on the NOAA Web site. The weather indicator seems to work sporadically, and I haven’t fully debugged it yet because of my lack of knowledge of Lua. I am at least able to tell that it is properly retrieving the data for my weather station to my machine.

For information to appear in the bottom status bar in Ion, you have to configure the template variable in cfg_statusbar.lua. My template in cfg_statusbar.lua is currently:

template = “[ %date || %weather_location: %weather_tempF %weather_sky %weather_weather (%weather_time) || CPU: %laptopstatus_cpuspeed %laptopstatus_temperature || BATT: %laptopstatus_batterypercent %laptopstatus_batterytimeleft || VOL: %volume_level %volume_state ] %filler%systray”,

The laptop information did not have to added to cfg_ion.lua or otherwise configured in cfg_statusbar.lua.

This template gives me a pretty good set of information: date, time, weather, my battery charge and the current volume. There are many other useful Lua scripts for Ion that integrate with the status bar, including scripts for several music players that can display the current song being played. All in all, a pretty good set of information that a typical nerd needs.

more about less mousing

If you are serious about mousing less, in either Ion or Gnome, then I recommend the Firefox extension Hit-a-Hint which when activated allows you to hit and hold the space bar to produce small numbers on Web pages near each link and form element. Typing the appropriate number highlights it, then releasing the space bar either follows the link or activates the form element. It may sound cumbersome, but it quickly becomes natural.

There are other mouseless browsing extensions to Firefox that I list in the resources below, but Hit-a-Hint appears to be the best one IMHO. The other alternative that may be compelling to some is Conkeror, which has functionality similar to Hit-a-Hint but has other features, like Emacs key bindings. Also, Opera has built in mouseless capabilities.

If you decide to stay with Gnome, then I recommend installing Tilda. By default, it binds to the F1 key and pops up a terminal window on top of all other windows. Its always active, so you can quickly switch back and forth between it while doing other things, and run longer running processes in it. It even provides tabbed terminal panes. It may not sound like much, but I’ve found Tilda to be a very convenient tool.

Another tool you may be interested in is XBindKeys, which allows you to assign custom keyboard shortcuts. Ion has its own way to customize key bindings, but I like XBindKeys for several reasons: I think its easier to configure, either manually or with a GUI interface. Also, if you choose not to use Ion, or switch back and forth between Ion and another window manager, your bindings will work the same in any of these environments.

For example, an application that you may commonly use, but may not think of it as such, is the Gnome (or KDE) volume manager applet that controls your speaker volume. I added the current volume level to my Ion status bar, but to quickly adjust it, I created the following XBindKeys shortcut in my ~/.xbindkeysrc file:

# gnome volume control”gnome-volume-control”Mod4 + v

The first line is documentation of the key binding, followed next by the actual command I want performed, then the key sequence to activate it. I mapped the Gnome volume control applet to the flying Windows key, so it works like part of Ion, and to the v key, which made sense, and was not previously used for any other shortcuts in Ion.

Finally, using a more fully featured non-graphical text editor like Vim or Emacs can help you take more control of your environment with minimal resources. I have regularly used Eclipse for the past few years, but I have been surprised by how many features that were once only available in graphical IDEs, most notably auto completion, can be added to these editors. I often use Vi/Vim anyway, but usually just for small tasks, usually on remote machines, and as such, I’ve only ever bothered to learn a small subset of its key commands.

Another option I have only recently become aware of is Cream. Cream is a set of configurations that makes Vim behave more like a modern application, so that you can save with CTRL-s, undo with CTRL-z, etc. It also makes Vim behave non-modally, so you don’t have to switch in and out of ‘insert’ mode. I am trying this out, but I am not yet sure if this is a good idea. On the one hand, this would allow me to use Vim in a way that I am more accustomed to using applications, so the keyboard shortcuts I already know will just work. On the other hand, will I lose what little Vi knowledge of have now, but use quite often, so that when I work on another machine without Cream, I will be frustrated? There’s something to be said for using standard tools and configurations, even if they aren’t optimized, although I am reassured by the fact that Cream is just a set of configurations on top of Vim and not some fork or specialized version of Vim.

Its hard to imagine programming Java in anything other than an heavy duty IDE like Eclipse or IDEA; the very nature of Java demands a tool like this to increase productivity. But when working in dynamic scripting languages like Python, Ruby or PHP which have spottier IDE support–and at the same time, much less need for heavy IDE support–Cream/Vim might still be an attractive option.

final thoughts

Time will tell how far I take my mouseless experimenting, but I’m already surprised at how quickly I’ve adapted to using the mouse less. Some things are still difficult to do without a mouse, for example, getting at Firefox toolbars and switching to different panels in Eclipse seems to be beyond the reach of my keyboard, at least in any practical way. Ajax-ified Web sites also sometimes challenge Hit-a-Hint, sites like Gmail for example.

Other types of applications, like Gimp and Impress to name the most obvious, are inherently graphical and pointer oriented. Of course, if you are worried about repetitive stress injury, or if you just want a more accurate, natural and flexible pointer experience, you could always shell out the money for a tablet and pen to replace your mouse.

Its also true that not every application is optimized for Ion’s approach to windowing. Some applications like Gimp tend to make use of several smaller windows in addition to one main window, which is itself often not maximized, and this approach to overlaying windows of varying sizes favors the more traditional windowing approach of Gnome/KDE/Windows/Mac instead of Ion’s maximized window/tiling approach. As I said though, Gnome is still there and you can switch back to it quickly using the CTRL-ALT-BACKSPACE sequence to restart X, so if you are a developer who only occasionally uses applications like Gimp, Ion may still be worth trying.

At this point, I am undecided if its worth trying to learn to work as productively in Cream/Vi as I do in Eclipse, or whether I should instead try to see if I can use Eclipse more productively without a mouse. (There is at least one plugin to add Emacs key bindings to Eclipse.) I actually use many default key bindings in Eclipse already, such as for commenting blocks, getting to the refactoring menu or running eclipse tests, which do make working in Eclipse faster, and there are many others available that I don’t use yet. But there are also things like running individual test cases in a suite that would be very hard–or even impossible–without a mouse.

Which brings up another point: it is by no means uncontroversial that mouseless computing is more efficient. But there are other advantages to using a mouse less, including less likelihood of repetitive stress injury. Ultimately, I think some tasks are faster with a mouse, others with a keyboard, and you have to find what works for you. But you won’t know what works best for you if you don’t try all the options available.

I am enjoying Ion very much, and even if I don’t fully embrace mouseless computing, I may very well stick with it. Ion allows you to use a mouse just as you normally do, so if you like the minimal tiling approach of Ion, you can get the best of both worlds.

resources

general mouseless computing discussions

  • Going commando – put down the mouse
  • Programming with mouse considered harmful
  • Basic Keyboard shortcuts
  • Mouseless computing

Ion

  • Ion Home
  • Ion3 Manual
  • Ion, The Efficient Window Manager
  • Ion3 – A tiling window manager – simple, lightweight, innovative
  • Ion Scripts Collection (contains some not found in Ubuntu distribution)

Lua

  • Lua article on Wikipedia
  • Lua Tutorial

Firefox plugins for mouseless computing

  • Conkeror, includes Emacs key bindings for Firefox
  • Hit-a-Hint
  • NumberFox
  • Mouseless Browsing

Eclipse

  • FAQ How do I provide a keyboard shortcut for my action?
  • Eclipse Keyboard Shortcuts
  • Keyboard shortcuts for Eclipse Java Editor

XBindKeys

other

  • Cream
  • Disable Touchpad Temporarily When Typing
  • Tilda
  • ratpoison

Related Post