dt.iki.fi

Resurrect a Nokia N900 ‑ Tweaking & Customisation

This article has a parent article.

Some suggestions are taken from this and this wiki article.

Power Kernel-up-

Just a better kernel. I'm not going to overclock.

http://wiki.maemo.org/Kernel_Power#Installing_the_Stable_Kernel

$ root
# apt-get install kernel-power-settings

The article then says shut down the device, and boot it up again. Confirm with uname -r.

Swappolube-up-

Simply install the swappolube package, open the UI and apply the suggested settings. Also see this wiki article.

Terminal-up-

The default terminal osso-xterm integrates well with the desktop, and we can access special keys through the terminal's toolbar and an onscreen keyboard (press the blue arrow key and the Ctrl key one after the other). Alternatives like xterm and mrxvt have the advantage of using bitmapped fonts, which are much smaller but still legible, but they do not integrate so well, at least not ootb.

I manually installed Ubuntu Mono, which gives me more rows and columns. See "Fonts" below.

Here's how to add more keys to the toolbar.

I also recommend to improve the shell's appearance & functionality:

  • a small prompt when working with osso-xterm, to have more horizontal space to enter commands
  • a larger prompt with more info when working through SSH
  • aliases etc.

On the desktop computer, we need to pass one environment variable; combine that into a handy alias for ssh'ing into your N900:

alias n900='TERM=linux ssh user@192.168.0.12'

On the N900 as user in your home directory /home/user/:

ln -s /root/.bashrc
ln -s /root/.profile

Then edit these files as root - /root/.profile:

# ~/.profile: executed by Bourne-compatible login shells.

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11
[ -d "$HOME/bin" ] && PATH="$HOME/bin:$PATH"
export PATH

# If not running interactively, don't do anything
if ! echo $- | grep -qo i; then return; fi

mesg n

if [ -f ~/.bashrc ]; then
  . ~/.bashrc
fi

/root/.bashrc:

case $TERM in
        linux)
        export PS1='\[\e[1;33m\][\u:\w] \$>\[\e[0m\] '
        ;;
        xterm)
        export PS1='\[\e[1;33m\]\w\$>\[\e[0m\]'
        ;;
esac

umask 022

export LS_OPTIONS='-h'
alias ls='/bin/busybox ls $LS_OPTIONS'
alias ll='/bin/busybox ls $LS_OPTIONS -al'
alias l='/bin/busybox ls $LS_OPTIONS -lA'

# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'

alias apt='apt-get'
alias search='apt-cache search'
alias showpkg='apt-cache showpkg'
alias policy='apt-cache policy'

Reading Man Pages-up-

man is part of a large and complex package creating a database and caching files. I don't want this, just the ability to read a formatted manual page every now and then.

To achieve this, install groff and try this command:

zcat /path/to/man/page.1.gz | groff -Tutf8 -man

If that for some reason should not work this might:

zcat /path/to/man/page.1.gz | nroff -man

Add a function to your .bashrc:

man() {
    [ -r "$1" ] && zcat "$1" | groff -Tutf8 -man \
    || echo "File $1 is not readable."
}

Fonts-up-

When I installed the Droid fonts ttf-droid, a full reboot was required to make them show up. The same goes for manually installed fonts.

I copied my local Ubuntu fonts to the device, Ubuntu Mono works well in the terminal at size 16; it's small enough to give me 18 rows and 71 columns in fullscreen, but still legible.

scp -r /usr/share/fonts/ubuntu/ root@192.168.0.12:/usr/share/fonts/truetype/

Create your own set of backgrounds-up-

The storage mounts like any old USB to my desktop computer. I create any amount (I choose four, for four virtual desktops) of background images and put them in the .images folder. I created very simple 8-bit PNG images - a dark grey solid background with the desktop number on it - for fast transitions. I copy & rename one of the existing .desktop files and edit it accordingly. Keep in mind that the phone sees the path as /home/user/MyDocs/ even though your computer might mount it as /media/Nokia N900 or some such.

That's all. Safely unmount the USB, unplug the cable - your new set of backgrounds should show up in Desktop Menu => Change Background.

Conky-up-

Conky can be installed from the repositories; at least two versions exist afaics. It works well enough, but not as a desktop background, as I am used to on my desktop computer. This can however be achieved with a few extra steps:

  1. Start conky from the command line: conky. Optionally, you can copy the system config to your home folder for easy editing: cp /etc/conky/conky.conf ~/.conkyrc - conky will pick that up as the new default config. Conky will show up, but either as a normal application with window decorations, or in a way that desktops can't be switched anymore.
  2. With conky running, use this oneliner to get information about currently open windows: xprop -root | grep '_NET_CLIENT_LIST_STACKING(WINDOW)' | tr ',#' '\n' | tail -n +2 | while read line; do xprop -id $line | grep -E 'WM_CLASS|WM_NAME'; echo '####################################'; done
  3. Conky should show up as WM_NAME(STRING) = "Conky (Nokia-N900)"
  4. Issue this command: xprop -name "Conky (Nokia-N900)" -f _HILDON_LIVE_DESKTOP_BACKGROUND 32i -set _HILDON_LIVE_DESKTOP_BACKGROUND -1 (*)

Success! Conky now shows up as an updating desktop background on all workspaces!

Thanks to this thread.

(*) Experimenting with the last number shows that conky can be either on all (-1) or one (1,2,3,4...) desktop, but not on e.g. two (2,3) backgrounds.
However, it's possible to start multiple conkys and give different titles with own_window_title, and multiple xprop commands.
Sometimes it's necessary to restart conky while experimenting.

How to make this happen automatically at boot-up-

First of all we need to find a way to make hildon-desktop autostart a custom list of commands. This apparently isn't so easy; eventually I came up with this:

Create the file /etc/X11/Xsession.post/98user-autostart:

#!/bin/sh

if [ -x $HOME/.config/autostart.sh ]; then

  run-standalone.sh $HOME/.config/autostart.sh &

fi

Then create the file /home/user/.config/autostart.sh:

#!/bin/sh

sleep 10 # seems necessary for the xprop command below

conky -d # -d = daemonize, so no & required. Default config: ~/.conkyrc
sleep 1
xprop -name "Conky" -f _HILDON_LIVE_DESKTOP_BACKGROUND 32i -set _HILDON_LIVE_DESKTOP_BACKGROUND -1

Make it executable: chmod +x ~/.config/autostart.sh

Other startup commands can be added here.

Battery-up-

One day I let my battery run down all the way to zero after the phone started complaining about a low battery. It ran for more than an hour (and I was working with it, not just standby) before it finally died. Doing this once should be good for calibration - except the status widget is still all over the place, sometimes showing e.g. 5% left, then jumping back to something much higher. Stil investigating: https://talk.maemo.org/showthread.php?t=100949 and https://talk.maemo.org/showpost.php?p=1410393&postcount=2.

In general, battery life is good. I bought the device used and don't know how old the battery is, but it looks like the original. It will last me more than a full day doing the sort of heavy duty stuff described in this article, and much longer in everyday usage.

Also see https://wiki.maemo.org/Smartreflex and https://talk.maemo.org/showpost.php?p=1064846&postcount=2 and https://talk.maemo.org/showpost.php?p=1050510&postcount=25.

Notes (please read)-up-

  • HAM - the graphical Hildon Application Manager
  • Update vs. Upgrade - in Debianspeak, "update" just updates the software catalogues, and "upgrade" actually upgrades all software packages. However, HAM uses the terms "refresh" and "update" instead.

In this article, I (try to) use the proper terms depending on context, i.e. if I use HAM, I speak of updates, if I use apt-get on the command line, I speak of upgrades.

When I write

Install package package

This actually means apt-get install package in a root terminal.