This manual covers flashing, operating, and customizing **Bananarchy Linux** (`240x320` native edition) on **Qualcomm MSM8905 and MSM8909** Nokia feature phones:
-`images/bananarchy-nokia-argon.img`: partitioned MBR image (`256 MiB``ext2``pmOS_boot` + `ext4``pmOS_root`) ready for EDL flashing to `userdata`, `fastboot flash userdata`, or raw `dd` to a microSD card.
- Additional device images (`bananarchy-nokia-beatles.img`, `bananarchy-nokia-tough.img`, `bananarchy-nokia-sparkler.img`) can be generated at any time via `./rebuild-image.sh <device> --mkinitfs`.
- Uses a lightweight cross-compiled **Xlibre** server with `modesetting` KMS, partial-rectangle `ShadowFB` SPI updates, and zero Wayland overhead.
- **Patched `dwm`** provides a `240x320` vertical bottom-stack (`bstack`) layout, a 24px top status bar, a transparent `"Menu"` / `"Names"` desktop softkey bar, a Conky desktop clock and status widget (which refreshes automatically when changing time, timezone, or wallpaper, or when logging out), and `< 2 ms` handling of physical slider (`SW_LID`) and wake keys.
- Core phone applications (`dmenu`, `xdrawer`, `dialer`, `calllog`, `callscreen`, `contacts`, `sms`, `files`, `camera`, `themes`, `modem`, `networks`, `ringtones`, `wallpapers`, `music`) run as preloaded resident daemons (`dwm-plugin <name> --preload`) that sleep at 0% CPU and open instantaneously over FIFO/socket IPC.
- All UI elements share a single **XRDB theming engine** (`~/.xthemes/*.xth` -> `~/.Xresources`) with 20 preinstalled color schemes, proportional font sizing (`theme.baseFontSize`), and live reload without restarting X11.
- **From Bananarchy Linux**: open the **Power** menu (`End / Power` key or `System menu -> Power`), select **Reboot to loader** (`sxmo_power.sh loader`) to enter the `lk2nd` Fastboot menu, and select **EDL** (or let `flash-edl.sh` automatically send `fastboot oem reboot-edl`).
- **From ADB or Fastboot**: the script automatically sends `adb reboot edl` or `fastboot oem reboot-edl` if detected.
3. Uploads `bootloader/loaders/8110.mbn` via Sahara and connects to eMMC via Firehose.
4. Backs up `gpt.bin`, `fsc`, `fsg`, `modemst1`, `modemst2`, `persist`, and `boot` into `./backup/` if not already backed up.
5. Flashes `lk2nd-msm8909.img` to `boot`, flashes `images/bananarchy-<device>.img` to `userdata`, clears the stock `system` superblock, and reboots into Bananarchy Linux.
1. Enter the `lk2nd` Fastboot menu either by selecting **Reboot to loader** from the **Power** menu (`sxmo_power.sh loader`) or by holding **D-Pad down** while powering on the phone.
| **Left softkey (`Menu`)** | `XF86KbdLcdMenu1` (`KEY_MENU`) | Open **System menu**, close open menu, or wake and unlock when locked |
| **Right softkey (`Names` / `Back`)** | `XF86KbdLcdMenu2` / `BackSpace` (`KEY_BACK`) | On empty desktop: open **Contacts (`Names`)**; inside apps: open **App context menu** (or close menu if open); in T9 preedit: `BackSpace` |
| **Both softkeys together** | `KEY_MENU` + `KEY_BACK` | Toggle **XDrawer** (`xdrawer`) global phone controls overlay from anywhere |
| **Digits `0`–`9`, `*`, `#` (on idle desktop)** | `0`–`9`, `asterisk`, `numbersign` | Open **Dialer** (`xdialer`) and immediately insert the pressed digit, `*`, or `#` |
| **Call (green)** | `XF86PickupPhone` / `XF86Phone` (`KEY_SEND`) | Answer incoming call when ringing; on empty desktop: open **Call Log** (`xcalllog`); when locked: wake and unlock; in menus: confirm (`Return`); in apps: **2x** focus next window, **3x** cycle tiling layout |
| **End / Power (red)** | `XF86PowerOff` | Wake and unlock when locked, close open plugin/menu, or: **1x** open **Power menu**, **2x** cycle screen state, **3x** (or hold `400ms`) launch a new terminal |
| **D-Pad up / down** | `Up` / `Down` | Navigate menus and apps; in `st`: `Shift+Up`/`Shift+Down` (or `ScrlUp`/`ScrlDn` in `Ctl` mode) scrolls terminal history; in T9 preedit: toggle letter case (`a` <-> `A`) or jump `+4` / `-4` candidates |
| **D-Pad left / right** | `Left` / `Right` | On empty desktop: switch workspace tags (`-1` / `+1`); in T9 preedit: step back 1 candidate (`Left`) or commit candidate (`Right`); in idle `Ctl` mode: `Home` / `End` |
| **Slider close / open** | `SW_LID` (`lid:on` / `lid:off`) | **Close**: close open menu, turn off keypad backlight, and lock/turn screen off; **Open**: restore keypad backlight, unlock, and turn screen on |
> X11 screensaver/DPMS blanking is disabled so screen state is controlled cleanly by Sxmo. Automatic idle locking is disabled so the phone only locks when you explicitly ask it to (`Power -> Lock`, `XDrawer -> Lock`, `2x End / Power`, or closing the physical slider). To save battery, the display blanks after inactivity (`SXMO_UNLOCK_IDLE_TIME`, default 30s; `SXMO_LOCK_IDLE_TIME`, default 8s once locked) without locking. When the screen is off, wake and unlock in a single action by opening the slider or pressing **End / Power**, **Left softkey**, **Right softkey**, or **Call (green)**.
#### 3.1.1 Window tiling modes and switching combos
By default, `dwm` uses the **vertical bottom-stack (`bstack`, `TTT`)** layout so multiple `st` terminals stack **vertically (one under another)** to preserve full line width on the `240x320` portrait screen.
All fifteen phone applications are compiled as shared-object plugins (`/usr/lib/dwm/plugins/*.so`), preloaded at `dwm` startup, and awakened over `/tmp/dwm_plugin_<name>.fifo` in `< 2 ms`:
1. **System and context menus (`dmenu.so` / `dmenu` / `xdmenu`)**:
- **Open / close**: press **Left softkey (`Menu`)** for the **System menu** or **Right softkey (`Back`)** inside an application for its **Context menu**; press the same softkey or `Escape` to close.
- **Built-in submenus and instant toggles**: renders `sys`, `applications`, `scripts`, `modem`, `config`, `power` (including **Logout**, **Reboot**, **Reboot to loader**, **Reboot to EDL**, and **Poweroff**), `audio`, `notifications`, `wm`, `timezone`, `games`, `st`, and `nano` menus in place in `< 0.5 ms` without spawning external processes.
- **Script compatibility**: any script piping items into `/usr/bin/dmenu` or `sxmo_dmenu.sh` communicates with the resident daemon over `/tmp/dwm_plugin_dmenu.sock`.
- **Controls**: use `Up`/`Down` (or `1`–`9`) to select **Speaker**, **Earpiece**, **Ring Vol**, **Ringer** (`Ring+Vib` / `Vibrate` / `Silent` / `DND`), **Flashlight**, **Sound**, **Microphone**, **Screen**, or **Keypad**; use `Left`/`Right` or `Return` to adjust or toggle.
- **Open**: press any **`0`–`9`, `*`, or `#` key** on the empty desktop, or open **Dialer** from the System menu or Call Log.
- **Dialing and T9 search**: typing digits filters saved contacts and recent numbers by phone number and T9 name in real time. Hold **`0`** (`>= 420 ms`) or press `Right` / **Left softkey (`+Sign`)** to insert `+`.
- **USSD codes and `*#06#` Dual-SIM IMEI display**:
- Typing **`*#06#`** immediately opens the **Device IMEI (`*#06#`)** dialog showing `IMEI 1`, `IMEI 2`, and `IMEI SV`.
- Typing any USSD code (`*...#` or `#...#`, such as `*100#`) switches the center softkey to **`SEND`**. Pressing **Call (green)** or **Center `OK`** runs the USSD session inside an interactive in-dialer modal with scrollable carrier output and multi-step reply support.
- **Open**: press **Call (green)** on the empty desktop, or select **Call Log** from the System menu or Dialer.
- **Controls**: `Left`/`Right` switches between **`All`**, **`Missed`**, **`In`**, and **`Out`** tabs; `Up`/`Down` scrolls; **Call (green)** or **Center `OK`** dials the selected entry; **Left softkey (`Dialer`)** loads the number into the Dialer.
5. **Incoming and active call screen (`callscreen.so` / `xcallscreen`)**:
- **Automatic activation**: wakes the screen and opens automatically on incoming and outgoing calls. Pressing **Call (green)** during an active call reopens `xcallscreen` from anywhere.
- **Incoming call actions**: press **Call (green)**, **Left softkey (`Accept`)**, **`1`**, or **Center `OK`** to answer; press **`*`** or **`0`** to silence the ringer; press **End (red)**, **Right softkey (`Reject`)**, or **`#`** to decline.
- **`[2]` / `#` — call recording**: starts or stops recording call audio (`16 kHz` mono WAV) to `~/Recordings/call_<caller>_YYYYMMDD_HHMMSS.wav` with a live `REC MM:SS` badge.
- **`[3]` — audio route**: switches between **`EARPIECE`** and **`SPEAKER`**.
- **Open**: press the **Right softkey (`Names`)** on the empty desktop, or select **Contacts** from the System menu.
- **Search and actions**: type `0`–`9` for live T9/number filtering; press **Call (green)** to dial immediately; press **Center `OK`** for the contact details card (**Call Contact**, **Send SMS**, **Read Messages**, **Open in Dialer**, **Copy to SIM**, **Edit Contact**, **Delete Contact**); or press **Left softkey (`Options`)** for phonebook-wide actions.
- **Direct Dual-SIM QMI phonebook import and export**: select **Import from SIM** or **Export to SIM** in the **Options** menu (or **Copy to SIM** on an individual contact) to read or write `EF_ADN` SIM phonebook records directly over Qualcomm QMI UIM (`qrtr://0`) on either **SIM 1** or **SIM 2** — even on the inactive SIM slot.
- **Built-in contact editor**: create or edit contacts directly on the keypad (`#` cycles input mode, `*` inserts space, hold `0` or press `Right` for `+`, or pick from recent unknown callers).
7. **SMS manager and composer (`sms.so` / `xsms`)**:
- **Open**: select **Texts** from the System menu, or choose **Send SMS** / **Read Messages** from Contacts.
- **Conversations and thread view**: browse SMS threads and drafts with contact name resolution, unread indicators, and message bubbles (`Recv` and `Sent`).
- **Multi-tap composer**: pick a recipient from Contacts/Recents or type a number (hold `0` for `+`), compose messages with multi-tap keypad entry (`#` cycles input mode), monitor live character/segment counts (`0/160`), save drafts automatically, and send via **Call (green)**, **Center `OK`**, or **Left softkey**.
- **Controls and viewers**: navigate directories with `Up`/`Down`/`Left`/`Right`/`Return`, filter with `0`–`9`, toggle dotfiles with `*`, and cycle sort order (**Name** / **Date** / **Size**) with `#`.
- **Image preview and wallpaper installation**: pressing `Return` on any image file (`.jpg`, `.png`, `.bmp`, `.gif`, `.webp`, `.ppm`, `.tif`, `.ico`, `.svg`) opens the built-in image viewer (`*` toggles full-screen preview; **Left softkey (`Set Wall`)** installs the image into `~/Pictures/Wallpapers/`, applies it via `feh`, and refreshes Conky). You can also select **Preview Image** or **Set as Wallpaper** directly from the **Left softkey (`Actions`)** menu.
- **Audio playback and ringtone installation**: pressing `Return` on any audio or tracker module file opens it immediately in **Music (`xmusic`)**. From the **Left softkey (`Actions`)** menu on any audio/tracker file, select **Play in Music Player** to play it in `xmusic`, or **Set as Ringtone** to copy it to `~/Ringtones/` and set it as the active phone ringtone.
- **File management actions**: the **Left softkey (`Actions`)** menu also provides **View Text**, **Edit in Nano**, **New Folder**, **New File**, **Rename**, **Copy**, **Cut / Move**, **Paste Here**, **Properties**, **Open Terminal Here**, and **Delete**.
- **Open**: select **Camera** from the System menu or run `xcamera`.
- **Viewfinder and gallery**: streams live `800x600` frames from `/dev/video0` (`GC2395`) into a `240x180` 4:3 viewfinder. Press **Center `OK`**, **`5`**, or **Call (green)** to capture a JPEG to `~/Pictures/photo-YYYYMMDD-HHMMSS.jpg`; `*` or `1` toggles **Auto-Flash**; `0` or `2` toggles continuous **Torch**; `Up`/`Down` adjusts **Digital Zoom** (`1.0x` / `2.0x` / `4.0x`); `#` or `3` toggles the **3-second Self-Timer**; **Left softkey (`Gallery`)** opens the built-in photo gallery.
- **Open**: select **Themes** from the System, Apps, or Config menu, or run `xthemes`.
- **Live theme switching and customizer**: browse 20 preinstalled `.xth` schemes (`~/.xthemes/*.xth`) with live color swatches and press **Center `OK`** or **Call (green)** to apply across `dwm`, `dmenu`, `st`, and all plugins with zero restart. Press **`*`** or **Left softkey** to customize individual colors and font sizes, save a custom theme (`#`), or edit the `.xth` file in Nano.
- **Controls**: preview built-in, tracker module (`.mod`, `.xm`, `.it`, `.s3m`, etc.), and user ringtones (`~/Ringtones/`, `~/Music/`, `/usr/share/sxmo/ringtones/`, `/usr/share/sxmo/music/`) at the configured ringtone volume with `*` or **Left softkey (`Play` / `Stop`)**, press `Return` to set the active ringtone, and switch to **`2:Settings`** to configure **Ringer Mode**, **Ring Volume** (`0%`–`100%`, also adjustable in **XDrawer**), **Ring Duration**, **Ring Loop Count**, and 3-level hardware **Vibrate Strength** (`Level 1` gentle `1400 mV`, `Level 2` medium `2100 mV`, `Level 3` strong `3100 mV`).
- **Open**: select **Wallpapers** from the System, Config, or Apps menu, or run `xwallpapers`.
- **Controls**: browse system and user wallpapers with a live portrait thumbnail, cycle scaling mode (`Fill`, `Scale`, `Fit`, `Center`, `Tile`) with `Left`/`Right` or `#`, toggle full-screen preview with `*`, and press `Return` to apply the wallpaper and immediately refresh the Conky desktop overlay.
15. **Music and tracker module player (`music.so` / `xmusic` / `xplayer`)**:
- **Open**: select **Music** from the System, Applications, or Audio menu, open any audio/tracker file from **Files (`xfiles`)**, or run `xmusic [file_or_dir]`.
- **Supported formats**: plays standard audio (`.wav`, `.mp3`, `.ogg`, `.flac`, `.opus`, `.m4a`, `.aac`) as well as classic chiptune/tracker modules (`.mod`, `.xm`, `.it`, `.s3m`, `.mptm`, `.stm`, `.med`, `.okt`, `.669`, `.ult`, `.far`, `.mtm`, `.ptm`, `.amf`, `.dsm`, `.imf`, `.gdm`, `.stx`, `.umx`, `.mo3`) via an embedded `mpv` + `FFmpeg` + `libopenmpt` backend that automatically pauses on incoming calls.
- **Three tabs (`1:Player`, `2:Queue`, `3:Files` — switch with `1`–`3` or `Left`/`Right` in Queue/Files)**:
- **`1:Player`**: displays format badge (`MOD`, `XM`, `MP3`, etc.), scrolling track title, artist/metadata, animated equalizer bars, elapsed/total progress bar, repeat mode (`Off`, `All`, `One`), shuffle state, and volume. Press `Return` or `5` to **Play/Pause**, `Left`/`Right` (`4`/`6`) to **Seek `-5s`/`+5s`**, `Up`/`Down` (`2`/`8`) to adjust **Volume**, `7`/`9` for **Prev/Next track**, `*` to cycle **Repeat**, `#` to toggle **Shuffle**, `0` to **Stop**, or **Left softkey (`Options`)** to install the current track as the phone ringtone.
- **`2:Queue`**: browse the active playlist queue, filter with `0`–`9`, press `Return` to jump to a track, `*` to remove a track, `#` to shuffle, or **Left softkey (`Actions`)** to set the selected track as ringtone or clear the queue.
- **`3:Files`**: browse the filesystem (`~/Music`, `/usr/share/sxmo/music`, `/usr/share/sxmo/ringtones`, or any folder), press `Return` to play a file and load its folder into the queue, `*` to append a file or folder to the queue, or `#` to play the entire current folder.
#### 3.1.3 Standalone keypad games (`Snake` and `Tetris`)
Two classic X11 games (`/usr/bin/snake` and `/usr/bin/tetris`) are accessible from **System menu -> Games**:
- **Snake (`snake`)**: steer with `2`/`8`/`4`/`6` or D-Pad; pause or restart with `5`/`Return`/`#`/`*`; quit with `Right softkey`/`BackSpace`/`Escape`.
- **Tetris (`tetris`)**: move with `4`/`6` (`Left`/`Right`), rotate with `2` (`Up`), soft drop with `8` (`Down`), hard drop with `0`/`5`/`Return`, pause with `#`/`*`, and quit with `Right softkey`/`BackSpace`/`Escape`.
- **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), showing a `1500ms` mode banner at the bottom of the screen.
- **Auto-commit timeout**: `1500ms` for keys with `<= 10` candidates, or `1800ms` for keys with `> 10` candidates. Pressing a different key immediately commits the active candidate.
- **Hold `*`**: in `123` mode, commits `.` (decimal point); in all other modes, toggles a one-shot **`Ctrl+` modifier latch** (`+^`) so the next key is sent as `Ctrl+<key>`.
*(In `Abc` and `ABC` modes, uppercase letters precede the digit and lowercase letters on keys `2`–`9`. In `Abc` mode, committing an alphabetic character automatically reverts to `abc`.)*
Launch **Bantam** directly from the System menu (`Left softkey -> Applications -> Bantam`), or run `bantam` in any terminal (`st`) or over SSH. Configure your endpoint and API key via environment variables or `~/.bantam.cfg` when needed.
The `msm8905-cam` kernel module drives the rear 2MP GalaxyCore `GC2395` sensor through MSM8909 `CAMSS` and registers `/dev/video0` (`800x600` 24-bit `RGB3`).
Both the rear loudspeaker (`Speaker`, with boosted `RX3 Digital Volume` for loud, clear ringtones and media) and the front earpiece speaker (`Earpiece`, boosted by +6 dB), as well as the internal MEMS microphone (`Mic1`) and 3.5mm headset microphone (`Mic2`), are managed through PipeWire/WirePlumber and `sxmo_audio.sh`: