Add preloaded SMS, File Manager, and Camera (live viewfinder) DWM plugins

This commit is contained in:
Luxferre
2026-10-21 14:46:11 +03:00
parent c1e5c646d6
commit 55b20c5b85
45 changed files with 4767 additions and 126 deletions
+26 -8
View File
@@ -139,8 +139,8 @@ 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 <name> --preload`), and awakened over `/tmp/dwm_plugin_<name>.fifo` in `< 10 ms`:
#### 3.1.2 Preloaded DWM plugins (`XDrawer`, `Dialer`, `Call Log`, `Contacts`, `SMS`, `Files`, `Camera`)
All seven core phone overlays are compiled as shared-object plugins (`/usr/lib/dwm/plugins/*.so`), preloaded at `dwm` startup (`dwm-plugin <name> --preload`), and awakened over `/tmp/dwm_plugin_<name>.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.
@@ -161,6 +161,22 @@ All four core phone overlays are compiled as shared-object plugins (`/usr/lib/dw
- **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`.
5. **`SMS Manager / Editor` (`sms.so` / `xsms` / `sxmo_modemtext.sh`) — Conversations & Composer**:
- **Open**: Select **Texts** from the Sxmo system menu (`Left softkey`), or choose **Send SMS** / **Read Messages** from Contacts.
- **Conversations List**: Shows all SMS threads and drafts from `~/.local/share/sxmo/modem/<number>/sms.txt` with contact name resolution, message previews, and timestamps. Press `0`–`9` for live T9/number search, `*` for a new message, **Center `OK` (`Return`)** to open the conversation, **Call (green)** to call the sender, or **Left softkey (`Options`)** for **New Message**, **Open Thread**, **Reply / Compose**, **Call Number**, **Save/View Contact**, and **Delete Thread**.
- **Thread View**: Displays incoming (`Recv`, green left accent) and outgoing (`Sent`, blue/gold right accent) message bubbles; `Up`/`Down` scrolls; **Center `OK` (`Return`)** opens the reply composer; **Call (green)** calls the contact.
- **Multi-Tap SMS Composer**: Supports picking a recipient from Contacts/Recents or entering a number directly (hold `0` for `+`), multi-tap text entry on keys `0`–`9` and `*` (`#` cycles `[Abc]` -> `[ABC]` -> `[abc]` -> `[123]`), live character and SMS segment counter (`0/160`), automatic draft persistence (`draft.txt`), and asynchronous sending via `sxmo_modemsendsms.sh` (`Call` key, `Send SMS` button, or `Left softkey`).
6. **`File Manager` (`files.so` / `xfiles` / `sxmo_files.sh`) — Graphical Directory Browser & Viewer**:
- **Open**: Select **Files** from the Sxmo system menu (`Left softkey`) or press `Mod4+d`.
- **Browser Controls**: `Up`/`Down` navigates files and directories; `Return`/`Right` enters a directory or opens the selected file; `Left`/`BackSpace` ascends to the parent directory (`..`); `0`–`9` filters items in real time; `*` toggles hidden dotfiles (`.*`); `#` cycles sort order (**Name** -> **Date** -> **Size**).
- **Built-in Viewers & File Actions (`Left softkey`)**: Text files and scripts open in a fast built-in scrollable viewer (with `Left softkey` shortcut to edit in `st -e nano`); JPEG and PNG images open in a built-in `libjpeg`/`libpng` previewer (`Left`/`Right` steps through images in the folder, `Left softkey` opens full screen in `feh`). The **Actions** menu supports **Open**, **Edit in Nano**, **New Folder**, **New File**, **Rename**, **Copy**, **Cut / Move**, **Paste Here**, **Properties**, **Toggle Hidden (`*`)**, **Cycle Sort (`#`)**, **Open Terminal Here**, and **Delete**.
7. **`Camera` (`camera.so` / `xcamera`) — Live Viewfinder & Photo Gallery**:
- **Open**: Select **Camera** from the Sxmo system menu (`Left softkey`) or run `xcamera` / `bananarchy-photo --menu`.
- **Live Viewfinder**: Streams `800x600` `RGB24` frames directly from `/dev/video0` (`msm8905-cam` / `GC2395`) into a `240x180` 4:3 viewfinder with a center reticle. Press **Center `OK` (`Return`)**, **`5`**, or **Call (green)** to snap a JPEG photo to `~/Pictures/photo-YYYYMMDD-HHMMSS.jpg`; `*` or `1` toggles **Auto-Flash**; `0` or `2` toggles continuous **Torch** (`white: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.
- **Built-in Photo Gallery**: Browse captured photos with `Left`/`Right` or `Up`/`Down`, press `Return` to open full-screen in `feh`, or press **Left softkey (`Delete`)** to delete a photo.
### 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]`).
@@ -254,15 +270,17 @@ All four core phone overlays are compiled as shared-object plugins (`/usr/lib/dw
## 5. Camera, audio, flashlight & cellular modem reference
### 5.1 Taking photos with the rear camera (`bananarchy-photo` & `/dev/video0`)
### 5.1 Taking photos with the rear camera (`xcamera`, `bananarchy-photo` & `/dev/video0`)
The `msm8905-cam` kernel module drives the rear 2MP GalaxyCore `GC2395` sensor through MSM8909 `CAMSS` (`CSIPHY0 -> CSID0 -> ISPIF -> VFE0 -> VBIF`) and registers `/dev/video0` (`800x600` 24-bit `RGB3`).
- **From the Sxmo keypad UI**:
Open the **System menu** (`Left softkey`) or **Apps menu** (`Left softkey` -> `Apps`) and select **Camera** (`bananarchy-photo --menu`). From the Camera menu you can:
- **Take photo**: capture a photo to `~/Pictures/photo-YYYYMMDD-HHMMSS.jpg` and immediately open it in `imv`.
- **Take photo (flash)**: turn on the rear flashlight (`white:torch`), capture a photo, restore the flashlight state, and open the photo in `imv`.
- **View photos**: browse all saved photos in `~/Pictures` using `imv` (press `Right softkey` inside `imv` to navigate, zoom, rotate, or quit).
- **From the Sxmo keypad UI (`xcamera` / `camera.so`)**:
Open the **System menu** (`Left softkey`) and select **Camera** (`xcamera`). The native DWM camera plugin streams a live `240x180` viewfinder from `/dev/video0` with:
- **Shutter (`Return` / `5` / `Call`)**: encodes an `800x600` JPEG directly to `~/Pictures/photo-YYYYMMDD-HHMMSS.jpg`.
- **Auto-Flash (`*` / `1`) & Continuous Torch (`0` / `2`)**: controls `white:torch` during or before capture.
- **Digital Zoom (`Up` / `Down`)**: cycles `1.0x`, `2.0x`, and `4.0x` center-crop zoom.
- **Self-Timer (`#` / `3`)**: toggles a 3-second countdown before capture.
- **Built-in Gallery (`Left softkey`)**: browse and delete saved photos in `~/Pictures` or press `Return` to open full-screen in `feh`.
- **From the CLI (`bananarchy-photo`)**:
```bash
# Capture to ~/Pictures/photo-YYYYMMDD-HHMMSS.jpg and print path