From ed65604706fc5272a75135f1a5571414c7a89591 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Wed, 21 Oct 2026 12:39:50 +0300 Subject: [PATCH] Document DWM plugin architecture, preloaded Dialer/CallLog/Contacts/XDrawer plugins, and desktop softkey labels --- MANUAL.md | 38 +++++++++++++++++++++++++++++++------- README.md | 12 +++++++++--- 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/MANUAL.md b/MANUAL.md index f641604..3ebcf26 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -28,7 +28,8 @@ This manual covers flashing, operating, and customizing **Bananarchy Linux** (`v - **Non-Nerd `Fira Code` with OpenType ligatures**: `Fira Code` (`font-fira-code`) is configured as the primary system and terminal font across Fontconfig, Xft, `st`, `dmenu`, `dwm`, `conky`, and `dunst`, with `DejaVu SansM Nerd Font` used strictly as a fallback for Private Use Area icon glyphs. - **Patched `sxmo-st` (`st`) with HarfBuzz ligatures & XIM**: patched with `libharfbuzz` (`hb.c`/`hb.h`) shaping (`liga`, `calt`, `clig`, `dlig`) so multi-character programming operators (`->`, `=>`, `!=`, `<=`, `>=`, `===`, `::`, `//`, `/*`) render as continuous ligatures at `pixelsize=18`, alongside full `XIM` (`fcitx5-t9`) input support. - **Patched `sxmo-dmenu` (`dmenu`) (`< 15 ms` startup)**: full-width `240x320` 9-line vertical menu (`lineheight = 26`, positioned flush at `Y = 24` right below the 24px `dwm` bar) with a `#383838` top search bar, `#005577` prompt badge, `#1c1c1c` item list, `XIM` (`XSetLocaleModifiers("")`, `XSetICFocus`, `Xutf8LookupString`) for live `fcitx5-t9` search filtering and `#` mode switching, C-level focus preservation (`prevfocuswin`), and direct Nokia keypad bindings. - - **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock)**: configured for `240x320` (`bh = 24`, `#323232` top bar, `#005577` active tag/border, vertical `bstack` layout default, overflow-protected Pango status bar rendering keeping the right-aligned clock always visible). Directly polls `/dev/input/by-path/platform-gpio-keys-event` (`SW_LID`) and intercepts locked-state wake keys (`XF86PowerOff`, `XF86PickupPhone`, `XF86KbdLcdMenu1`, `XF86KbdLcdMenu2`) in C to toggle `/sys/class/backlight/backlight/brightness` and `/sys/class/leds/white:kbd_backlight/brightness` in `< 2 ms` before running Sxmo state hooks asynchronously. + - **Patched `sxmo-dwm` (`dwm`) (`< 2 ms` display wake/unlock & native plugin system)**: configured for `240x320` (`bh = 24`, `#323232` top bar, `#005577` active tag/border, vertical `bstack` layout default, overflow-protected Pango status bar rendering keeping the right-aligned clock always visible, and a transparent-backgrounded bottom desktop softkey bar displaying `"Menu"` and `"Names"` over the wallpaper). Directly polls `/dev/input/by-path/platform-gpio-keys-event` (`SW_LID`) and intercepts locked-state wake keys (`XF86PowerOff`, `XF86PickupPhone`, `XF86KbdLcdMenu1`, `XF86KbdLcdMenu2`) in C to toggle `/sys/class/backlight/backlight/brightness` and `/sys/class/leds/white:kbd_backlight/brightness` in `< 2 ms` before running Sxmo state hooks asynchronously. + - **Preloaded DWM plugins (`src/dwm-plugins/` & `src/xdrawer/`, `< 10 ms` FIFO wakeup)**: `dwm` dynamically loads `.so` plugins from `/usr/lib/dwm/plugins/` and `~/.local/lib/dwm/plugins/` (`xdrawer.so`, `dialer.so`, `calllog.so`, `contacts.so`) and preloads them as resident background daemons (`dwm-plugin --preload`) at startup. Each daemon keeps its X11 window, offscreen `Pixmap`, Xft/Pango layouts (`15px` `Fira Code, DejaVuSansM Nerd Font`), and `stat()`-cached Sxmo TSV state initialized in memory while sleeping at 0% CPU on `/tmp/dwm_plugin_.fifo`. 2. **Multi-mode `fcitx5-t9` keypad engine (`src/fcitx5-t9/`)**: - Supports 6 input modes cycled with `#` (`XF86NumericPound`): `abc`, `Abc`, `ABC`, `Sym`, `Ctl`, and `123`, updating the live top-bar status indicator (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`) in real time. - Locks the candidate popup bar to the bottom of the screen (`X = 1, Y = 290, W = 238, H = 30`) with fixed-width 28-character monospace formatting (`Fira Code 9.5`), so neither the popup window nor individual letters ever jump when cycling through candidates. @@ -103,13 +104,14 @@ sudo dd if=./images/bananarchy-nokia-argon.img of=/dev/sdX bs=4M status=progress | Physical key | Linux keysym / event | Action in Sxmo | | :--- | :--- | :--- | -| **Left softkey** | `XF86KbdLcdMenu1` (`KEY_MENU`) | Open **System menu**, close open menu, or wake & unlock when locked | -| **Right softkey / Back** | `XF86KbdLcdMenu2` / `BackSpace` (`KEY_BACK`) | Open **App context menu** (or close menu if open); in apps/T9 preedit acts as `BackSpace` | +| **Left softkey (`Menu`)** | `XF86KbdLcdMenu1` (`KEY_MENU`) | Open **System menu**, close open menu, or wake & unlock when locked | +| **Right softkey (`Names` / `Back`)** | `XF86KbdLcdMenu2` / `BackSpace` (`KEY_BACK`) | On empty desktop: open **`Contacts` (`Names`)** phonebook plugin; 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 (Speaker, Earpiece, Flashlight, Sound, Microphone, Screen, Keypad) from anywhere | -| **Call (green)** | `XF86PickupPhone` (`KEY_SEND`) | Wake & unlock when locked, confirm (`Return`) in menus, or: **1×** answer call / **App context menu**, **2×** **Focus next window**, **3×** **Toggle tiling layout** (`vertical` -> `horizontal` -> `tabbed`) | -| **End / Power (red)** | `XF86PowerOff` | Wake & unlock when locked, close open menu, or: **1×** **Power menu** (`space` shutter in Megapixels), **2×** cycle screen state, **3×** (or hold `400ms`) launch new terminal | -| **D-Pad up / down** | `Up` / `Down` | Navigate menus/apps; in T9 preedit: toggle letter case (`a` ↔ `A`) or jump `+4` / `-4` candidates; in idle `Ctl` mode: `Page_Up` / `Page_Down` | -| **D-Pad left / right** | `Left` / `Right` | Move cursor; in T9 preedit: step back 1 candidate (`Left`) / commit candidate (`Right`); in idle `Ctl` mode: `Home` / `End` | +| **Digits `0`–`9`, `*`, `#` (on idle desktop)** | `0`–`9`, `asterisk`, `numbersign` | Open **`Dialer`** (`xdialer`) and immediately insert the pressed digit/`*`/`#` | +| **Call (green)** | `XF86PickupPhone` / `XF86Phone` (`KEY_SEND`) | Answer incoming call when ringing; on empty desktop: open **`Call Log`** (`xcalllog`); when locked: wake & unlock; in menus: confirm (`Return`); in apps: **2×** **Focus next window**, **3×** **Toggle tiling layout** | +| **End / Power (red)** | `XF86PowerOff` | Wake & unlock when locked, close open plugin/menu, or: **1×** **Power menu** (`space` shutter in Megapixels), **2×** cycle screen state, **3×** (or hold `400ms`) launch new terminal | +| **D-Pad up / down** | `Up` / `Down` | Navigate menus/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`) / commit candidate (`Right`); in idle `Ctl` mode: `Home` / `End` | | **Center OK** | `Return` (`KEY_OK`) | Confirm / Enter, or commit active T9 preedit candidate immediately | | **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 | @@ -137,6 +139,28 @@ You can switch between **vertical stack (`TTT`, `bstack`)**, **horizontal tile ( - `Mod4+1`..`4`: switch to workspace tag `1`..`4` - `Mod4+Shift+q`: close focused window +#### 3.1.2 Preloaded DWM plugins (`XDrawer`, `Dialer`, `Call Log`, `Contacts`) +All four core phone overlays are compiled as shared-object plugins (`/usr/lib/dwm/plugins/*.so`), preloaded at `dwm` startup (`dwm-plugin --preload`), and awakened over `/tmp/dwm_plugin_.fifo` in `< 10 ms`: + +1. **`XDrawer` (`xdrawer.so` / `xdrawer`) — Global Phone Controls**: + - **Open / Close**: Press **both softkeys simultaneously** (`KEY_MENU` + `KEY_BACK`) from anywhere, or select `XDrawer` from the Sxmo menu. + - **Controls**: `Up`/`Down` selects a row (**Speaker Volume**, **Earpiece Volume**, **Flashlight**, **Sound**, **Microphone**, **Screen Brightness**, **Keypad Backlight**); `Left`/`Right` adjusts sliders or toggles; `Return` flips toggles; `1`–`7` jumps directly to row `1`–`7`; `Escape` or both softkeys closes the drawer. + +2. **`Dialer` (`dialer.so` / `xdialer`) — Keypad Dialer with Contact Integration**: + - **Open**: On the empty desktop, press any **`0`–`9`, `*`, or `#` key** (which opens the dialer and immediately inserts that character), or launch **Dialer** from the Sxmo menu or Call Log. + - **Dialing & T9 Filtering**: Typing digits filters saved contacts (`~/.config/sxmo/contacts.tsv`) and recent numbers (`modemlog.tsv`) by phone number and T9 contact name in real time. Hold **`0`** (`>= 420 ms`) or press **D-Pad `Right`** / **Left softkey (`+Sign`)** to insert `+`. + - **Navigation & Calling**: `Up`/`Down` selects a matching contact or recent number; **Call (green)** or **Center `OK` (`Return`)** places the call immediately; **Right softkey (`Clear` / `Close`)** or **`BackSpace`** deletes digits or closes the dialer; **Left softkey (`Call Log`)** when empty switches directly to the Call Log. + +3. **`Call Log` (`calllog.so` / `xcalllog`) — Call History Viewer**: + - **Open**: On the empty desktop, press **Call (green)** (`XF86PickupPhone` / `XF86Phone`), or select **Call Log** from the Sxmo menu or Dialer. + - **Controls**: `Left`/`Right` switches between **`All`**, **`Missed`**, **`In`**, and **`Out`** filter tabs; `Up`/`Down` scrolls through call entries (showing direction icon, resolved contact name or number, timestamp, and call duration); **Call (green)** or **Center `OK` (`Return`)** dials the selected entry; **Left softkey (`Dialer`)** opens the selected number in the Dialer; **Right softkey (`Close`)** or `Escape` closes the Call Log. + +4. **`Contacts` (`contacts.so` / `xcontacts` / `sxmo_contactmenu.sh`) — Full-Featured Phonebook**: + - **Open**: On the empty desktop, press the **Right softkey (`Names`)**, or select **Contacts** from the Sxmo menu. + - **Phonebook List & Live Search**: Typing `0`–`9` filters contacts in real time by T9 name or phone number; `Up`/`Down` scrolls; **Call (green)** immediately calls the selected contact; **Center `OK` (`Return`)** opens the contact's details & actions card; **Left softkey (`Options`)** opens the options menu (**New Contact**, **Add from Recent**, **Call Contact**, **Send SMS**, **Edit Contact**, **Delete Contact**). + - **Contact Details View**: Provides one-click actions for **Call Contact**, **Send SMS**, **Read Messages**, **Open in Dialer**, **Edit Contact**, and **Delete Contact**. + - **Built-in Contact Editor**: Supports adding new contacts or editing existing contacts directly in the `240x320` UI. In the **Name** field, keypad keys `0`–`9` provide multi-tap character entry (`#` cycles case mode `[Abc]` -> `[ABC]` -> `[abc]` -> `[123]`, `*` inserts space). In the **Number** field, hold `0` or press `Right` to insert `+`, or select **Use Recent Number** to pick from recent unknown callers in `modemlog.tsv`. Press **Left softkey (`Save`)** or select **Save Contact** to write directly to `~/.config/sxmo/contacts.tsv`. + ### 3.2 Multi-mode `fcitx5-t9` keypad reference - **Short-press `#`** *(when no character is in preedit)*: cycles through the 6 input modes (`abc` -> `Abc` -> `ABC` -> `Sym` -> `Ctl` -> `123` -> `abc`), displaying a `1500ms` preedit status banner (`[Mode: abc]`, `[Mode: Abc]`, `[Mode: ABC]`, `[Mode: Sym]`, `[Mode: Ctl]`, `[Mode: 123]`). diff --git a/README.md b/README.md index f8a5a6b..400cd24 100644 --- a/README.md +++ b/README.md @@ -9,9 +9,13 @@ See [The Bananarchy Manifesto](./MANIFESTO.md) for the rationale behind this ent Bananarchy targets an ultra-lightweight **Sxmo X11 (`sxmo-de-dwm`)** environment (with all Wayland components removed), featuring: - **Cross-compiled Xlibre (`X11Libre/xserver` 25.2.0) display server**: `modesetting` KMS + `ShadowFB` Damage partial-rectangle SPI transfers, software cursor fallback, and rootless `elogind` integration. -- **Patched `sxmo-dwm`**: `240x320` vertical `bstack` layout, 24px Pango status bar with an overflow-protected right-aligned clock, and direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`. +- **Patched `sxmo-dwm` with native C/C++ plugin architecture**: `240x320` vertical `bstack` layout, 24px Pango status bar with an overflow-protected right-aligned clock, transparent-backgrounded `"Menu"` and `"Names"` desktop softkey labels, direct C `SW_LID` slider and locked-key wake handling in `< 2 ms`, and a dynamic `.so` plugin API (`dwm_plugin.h`) with preloaded resident daemons (`--preload`) and non-blocking FIFO IPC (`< 10 ms` wakeup latency). +- **Preloaded `240x320` keypad-driven DWM plugins (`xdrawer`, `dialer`, `calllog`, `contacts`)**: + - **`XDrawer` (`xdrawer.so` / `xdrawer`)**: global phone controls overlay invoked from anywhere by pressing **both softkeys simultaneously**, providing instant sliders and toggles for speaker volume, earpiece volume, flashlight, sound mute, microphone mute, screen brightness, and keypad backlight. + - **`Dialer` (`dialer.so` / `xdialer`)**: opens automatically from the idle desktop when pressing any **`0`–`9`, `*`, or `#` key** (inserting that character immediately), with live T9/number contact filtering, hold-`0` for `+`, and single-press **Call** dialing. + - **`Call Log` (`calllog.so` / `xcalllog`)**: opens automatically from the idle desktop when pressing the **Call (green)** button, with `All` / `Missed` / `In` / `Out` tabs, contact resolution, call durations, and instant redial. + - **`Contacts` (`contacts.so` / `xcontacts`)**: full-featured phonebook application opened from the idle desktop via the **Right softkey (`Names`)** or from the Sxmo menu, integrated with `~/.config/sxmo/contacts.tsv` (live T9/number search, call/SMS/dialer actions, built-in contact editor with keypad multi-tap name entry and recent-caller number picker, and contact deletion). - **Patched `sxmo-dmenu`**: `240x320` full-width 9-line vertical menu flush below the 24px top bar with a `#383838` search bar, `#005577` prompt badge, and `XIM` `fcitx5-t9` text input in `< 15 ms`. -- **`XDrawer` global phone controls drawer (`xdrawer`)**: lightweight `240x320` C++17 X11/Pango/ALSA overlay invoked from anywhere by pressing **both softkeys simultaneously**, providing instant sliders and toggles for speaker volume, earpiece volume, flashlight, sound mute, microphone mute, screen brightness, and keypad backlight. - **Patched `sxmo-st` terminal (`pixelsize=18`)**: **HarfBuzz (`libharfbuzz`) OpenType ligature shaping** (`liga`, `calt`, `clig`, `dlig`) and `XIM` support. - **Typography**: non-Nerd **`Fira Code` (`font-fira-code`) with ligatures** as the primary system and terminal font (with `DejaVu SansM Nerd Font` used strictly as an icon fallback). - **Custom 6-mode `fcitx5-t9` input engine**: fixed bottom candidate bar (`X=1, Y=290, W=238, H=30`) with a constant 28-character monospace preedit layout supporting lowercase, one-shot Shift, Caps Lock, all 32 ASCII punctuation symbols, terminal control codes (`^A`-`^Z`, `Esc`, `Tab`, `F1`-`F12`), and direct numeric entry with live top-bar mode indication (`[abc]`, `[Abc]`, `[ABC]`, `[Sym]`, `[Ctl]`, `[123]`). @@ -85,7 +89,9 @@ bananarchy/ │ └── fcitx5-t9/ │ └── 0001-bananarchy-multimode-t9-and-fcitx5-5.1.19.patch ├── src/ -│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, direct C SW_LID & locked-key wake) +│ ├── sxmo-dwm/ # Patched sxmo-dwm (240x320 bstack, Pango bar, desktop softkey bar & plugin API) +│ ├── dwm-plugins/ # DWM plugins (dialer.so, calllog.so, contacts.so), shared phone/TSV lib & runner +│ ├── xdrawer/ # XDrawer global phone controls DWM plugin (xdrawer.so / xdrawer) │ ├── sxmo-dmenu/ # Patched sxmo-dmenu (240x320 vertical 9-line menu, #383838 search bar, XIM fcitx5-t9) │ ├── sxmo-st/ # Patched sxmo-st terminal with HarfBuzz Fira Code ligature shaping & XIM │ ├── xf86-input-libinput/ # X11Libre xf86-input-libinput DDX driver