Näytetään tekstit, joissa on tunniste n900. Näytä kaikki tekstit
Näytetään tekstit, joissa on tunniste n900. Näytä kaikki tekstit

torstai 17. kesäkuuta 2010

Configuring the power button menu

To start or focus an application in N900, you can simply hit the bottom right corner (if in full screen mode), hit the top left screen some times to get to app list/desktop/task manager, scroll to the correct desktop page or position in app list if needed, find the correct icon and tap it. Unless, of course, you happen to have a full screen Debian app where you'd open the keyboard and type Ctrl+space first, or some unresponsive app that won't react to the bottom right corner app where you'd, well, wait and hope the situation isn't over when you get there. What could be easier?

Found that sometimes a bit difficult while biking and was looking for better solutions. One major enhancement being mapping the camera focus button to the task manager/dashboard with camkeyd/shortcutd, that made one handed task switching a lot easier. Then I was looking at the etc/systemui/systemui.xml file to add a reboot entry in the menu and noticed actually any function can be added so there I had the quick menu I had wished for:


Instructions for creating menu entries I have already written to Maemo Talk here so I'll not replicate them here, lets have this entry just a pointer there.

keskiviikko 16. kesäkuuta 2010

Running X-Pilot in N900


X-Pilot is one of my all-time favourites. Those were the times, having ten nationalities fighting each other when I spent a bit too many night hours in school X-terminal rooms..

After some years, it arrived to Windows.

Now, after some more years, it has arrived to my pocket. This article tells how to.


Installing Easy Debian

1. Install "Easy Debian" from app manager
2. Run "Deb Img Install" from app list
3. It'll ask where to store a big image file, choose anything you like.

Installing X-Pilot
1. In the application list, run "Debian chroot"
2. apt-get install xpilot-ng

Running X-Pilot (local)

1. Open two (one to use an external server) Debian chroot XTerms by the "Debian chroot" icon in the application list.
2. In both (or the only one) of them, enter "su user" to use a normal user instead of root.
3. Run "Set Deb HW Keys" in the application list. This allows changing to full screen in Debian apps.
4. In one of the XTerms, type /usr/games/xpilot-ng-server (not needed for external servers)
5. In the other one, type /usr/games/xpilot-ng-x11
6. Hit "Local" for local server or "Internet" for external servers. Hit any "Join" button to use local server or select any of the Internet servers.
7. Type Ctrl+Space to change to full screen.
8. Kill all enemies.

The default keymap isn't that well suited for N900 so will need to be modified. In X-Pilot, select Menu->Config->Save configuration (some hits on More in between) to create a template ~/.xpilotrc file with commented key mappings. Uncomment the lines you want (be sure to not leave any spaces before the entries) and add suitable button codes.

Control by tilting the device might be a decent mouse substitute (not that easy to control three dozen controls by two thumbs, and that's all you can use really), that might be possible with Accelemymote if XPilot can be configured to read a joystick, or by translating accelerometer values to mouse moves.

Desktop Command Execution Widget

Desktop Command Execution Widget - All the information you need on your desktop.

My script with uptime, CPU load, battery level (or two, see below), RAM free and (battery) temperature:Battery level is here presented by the normal way and with the bq27x00-battery module that comes with the Power Kernel, neither of which seems to be very close. Actually, the average might be pretty good. Even more unreliable they are while charging, like in the image.

Also the temperature display needs the Power Kernel.

The script:
echo -n "Up:";uptime |cut -d " " -f 4- ;
echo "Battery level: `lshal|grep percentage|tr -s " "|cut -d " " -f 4|sort -n|head -1` %";
awk '/mT/ {memttl = $2}; /mF/ {memfre = $2}; /Bu/ {membff = $2}; $1 == "Cached:" {memcch = $2} END {printf ("RAM free: %.1f MB\n",(memttl-memfre-membff-memcch)/1024)}' /proc/meminfo;
echo Temp: `cat /sys/class/power_supply/bq27200-0/temp`

How to:
1. Install Desktop Command Execution Widget using app manager
2. Touch the desktop background, then the gear icon
3. Desktop menu -> Add widget
4. Desktop Command Execution Widget
5. Touch the wrench icon on the new widget that initially shows time and uptime
6. Add Cmd
7. Title="Show all" or whatever you like, script cut'n'paste as above, Save
8. Configure the settings:
- Select the saved command with the "Commands" button, if not already selected
- Width = 0.60(adjust if needed)
- Height = 4.3 (adjust if needed)
- Uncheck "Display Title" (just takes space)
- Check all the "Update" checkboxes
- Update interval = 1 minute, for example
- Network presence = Disabled
9. Save, Done

You should now see the display as in the image above. Only one battery level display and no temperature unless the bq27x00-battery kernel module is loaded.

How to enable the battery kernel module:
1. Install "Enhanced Linux kernel for power users" and "Enhanced Linux kernel for power users (settings)" with app manager
2. Open X-Term with user root
3. Create this file:
/root/startup.sh:
#!/bin/sh
modprobe bq27x00-battery

3. chmod u+x /root/startup.sh
4. Run that file as root. Needs to be run every time the device is restarted, I do it by hitting the "root XTerm" icon on my desktop and "./st" but could of course be added to startup scripts.