Skip to content

omamobile-shell 0.2.107: Grok Bot fits the phone's screen - #542

Merged
derekross merged 3 commits into
derekross:mainfrom
jkjoplin:shell-grok-bot-fits-the-phone
Nov 9, 2026
Merged

derekross merged 3 commits into
derekross:mainfrom
jkjoplin:shell-grok-bot-fits-the-phone

Conversation

@jkjoplin

@jkjoplin jkjoplin commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

What and why

Grok Bot (grok-bot from [omarchy], x.ai's agent, an Electron app) runs off the right edge of the phone's screen. Its main process sets a minimum window size of 512x520 (SAND_MIN_WINDOW_SIZE), and the Pixel 7 Pro is 480 px wide in logical pixels. Hyprland gives the window 480x996, but the app lays itself out 512 px wide, so the right 32 px are cut off: the ends of messages, the header's buttons, and the composer's microphone. Chromium has the same problem, and omamobile-setup-user already gives it --force-device-scale-factor=0.83 (AGENTS.md, Userspace).

This adds the same step for Grok Bot. Its launcher (/usr/bin/grok-bot) reads ~/.config/grok-bot-flags.conf. The new step picks the factor from the panel's mode (the DSI connector in /sys/class/drm) and the monitor scale setup-user seeds, aiming at the layout width Chromium gets on the 7 Pro (480 / 0.83 = 578 px):

Panel at its scale Logical width Factor Layout width
7 Pro, 1440x3120 at 3 480 0.83 578
9a, 1080x2424 at 8/3 405 0.70 578
a 1080x2400 panel at 3 360 0.62 580
no readable mode 0.83

A single 0.83 wouldn't do it beyond the 7 Pro: on the 9a it leaves 488 px and on a 1080 px panel at scale 3 it leaves 434 px, both under 512. It runs once, a factor the user's file already has stays theirs, and other flags in the file are kept. I left out Chromium's --wayland-text-input-version=3: the on-screen keyboard came up in Grok Bot's composer before any flags, so I had no reason to add it. AGENTS.md gets a line under the Chromium gotcha.

Chromium's own step keeps its fixed 0.83. The same panel-based factor would suit it on the 9a and on 1080 px panels too, if you want that as a follow-up.

Device and build

  • Phone: Pixel 7 Pro (cheetah), Omarchy 4.5.0-3
  • Kernel release (uname -r): 7.3.0-rc6-omamobile-push1-g1cb4bd36f3be
  • Packages changed, with versions: omamobile-shell 0.2.107 (the version is provisional; renumber as you like)

Checks (no phone needed)

  • tools/pr-check origin/main passes
  • tests/all passes
  • tests/packages passes, except omamobile-audio's alsa-lib control access check ("nothing readable"). It fails on my laptop because the laptop's first sound card is its own Apple T2 audio, and this PR doesn't touch omamobile-audio.
  • Each changed package has its version bumped, and the new version is in the commit subject
  • Commits have area prefixes and bodies that say why; any AI help is a Co-Authored-By: or Assisted-by: trailer, never a Signed-off-by:

test/setup-user.sh covers the 7 Pro (0.83), the 9a (0.70), a 1080x2400 panel (0.62), no readable mode (0.83), an external display's mode not being read, a user's own factor and flags kept, and the flags written once over two logins. Its first new check fails against the current script. The package's test/all: 299 ok.

On the phone

  • I ran this on my own phone, booted into this build: not the package build. The phone runs omamobile-shell 0.2.100. What I ran:
    • --force-device-scale-factor=0.83 by hand in ~/.config/grok-bot-flags.conf, then a restart of Grok Bot: the window fits (the full message width, the header's buttons and the microphone are all on screen), checked against screenshots from before and after. I'm not attaching them, because they show my own conversations.
    • The new step alone, run on the phone as the user against a scratch home with the real /sys/class/drm and device tree: it read 1440x3120 from card2-DSI-1 and wrote --force-device-scale-factor=0.83, the same factor as the hand-made file.
  • What I did not test: the step through omamobile-setup-user.service at a login, the 9a and 1080 px panels (unit test only), and whether 0.70 and 0.62 are comfortable to read there.
  • Nothing in this change writes outside slot B and userdata, weakens the storage guard, or reads registers from userspace (AGENTS.md §1)
tools/phone-smoke report

phone-smoke: cheetah

Kernel 7.3.0-rc6-omamobile-push1-g1cb4bd36f3be, tools at 20790a8, 2026-11-08T21:51Z.

Check Result Detail
boot (required) ok kernel 7.3.0-rc6-omamobile-push1-g1cb4bd36f3be, slot b, up 3612s
storage guard (required) ok 55 partitions; only userdata and slot B's boot images writable
root (required) ok ext4 on userdata, 94G free
kernel health (required) ok no oops or BUG; 0 WARN, 0 error lines in dmesg (0 known, 0 new)
systemd units ok none failed
USB gadget (required) ok bound to 11210000.usb
display ok card2-DSI-1 connected, 1440x3120
GPU ok render node on panthor
session (required) ok Hyprland and the Omarchy shell running
lock ok PAM file present, the shell can lock (passwordPam true, locked false)
touch ok Synaptics TouchComm Touchscreen
buttons ok gpio-keys
Wi-Fi ok wlp1s0 on brcmfmac, link up
Bluetooth ok hci0, powered false
battery ok 68% Charging, 36 °C
sound cards ok googleaocsndcar
sensors ok Accelerometer AmbientLight Proximity
cameras ok 4 listed by libcamera
thermal ok hottest zone 36 °C

Packages: hyprland 0.57.0-3.1, libcamera 0.7.2-4.22, mesa 1:26.2.4-1.4, omacam 0.3.3-1, omamessages 0.2.2-1, omamobile-apps 0.2.2-1, omamobile-audio 0.5.13-1, omamobile-device-cheetah 0.1.44-1, omamobile-fingerprint 0.1.15-1, omamobile-firstboot 0.1.3-1, omamobile-gnss 0.2.7-1, omamobile-keyring 20261026-1, omamobile-mirror 0.1.1-1, omamobile-modem 0.1.16-1, omamobile-omarchy 0.1.36-1, omamobile-owl-widgets 0.1.2-1, omamobile-sensors 0.2.1-1, omamobile-shell 0.2.100-1, omaphone 0.2.3-1, omarchy 4.5.0-3, omatel-agent 0.2.4-2, quickshell 0.3.2.r7.g2b4501a-1

🤖 Generated with Claude Code

https://claude.ai/code/session_01TTVicoVA5YdXzobkXGujF9

Grok Bot (grok-bot from [omarchy], x.ai's agent, an Electron app) sets
a minimum window size of 512x520 (SAND_MIN_WINDOW_SIZE in its main
process). The Pixel 7 Pro is 480 px wide in logical pixels, so the app
laid itself out 512 px wide inside a 480 px window and ran off the right
edge: the ends of messages, the header buttons and the composer's
microphone were cut off. Chromium had the same problem and setup-user
gives it --force-device-scale-factor=0.83.

setup-user now does the same for Grok Bot, whose launcher reads
~/.config/grok-bot-flags.conf. The factor comes from the panel's mode
(the DSI connector in /sys/class/drm) and the monitor scale setup-user
seeds, so the layout gets about the 578 px Chromium gets on the 7 Pro:
0.83 on the 7 Pro (480 px), 0.70 on the 9a (405 px), 0.62 for a
1080 px panel at scale 3 (360 px), where 0.83 would leave 434 px, still
under 512. With no readable mode it falls back to 0.83. Once, and a
factor the user's file already has stays theirs.

Tested on a Pixel 7 Pro (Omarchy 4.5.0-3, omamobile-shell 0.2.100):
the factor by hand made the window fit (screenshots before and after);
the new step, run alone on the phone against a scratch home, read
1440x3120 and wrote 0.83. test/setup-user.sh covers the 7 Pro, the 9a,
a 1080x2400 panel, no mode, a user's own factor and two logins; its
first new check fails against the old script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTVicoVA5YdXzobkXGujF9
@derekross

Copy link
Copy Markdown
Owner

Thanks, Jeremy, this is a tidy fix, and I appreciate that you ran both the factor and the new step on your 7 Pro and kept your conversations out of the screenshots.

I checked the two facts it rests on in Omarchy's signed grok-bot package (0.78.3): the launcher does read ~/.config/grok-bot-flags.conf (comments stripped, flags appended to the exec line), and the app's minimum window is 512x520. The arithmetic matches your table, and $scale is set before the monitor step's once-only block, so the new step works on later logins too.

One thing I'll fix at merge: main shipped omamobile-shell 0.2.107 with #420 after you branched, and your version file makes the same 0.2.106 → 0.2.107 change, so git merges it without a conflict and the package would keep a version that's already published. I'll set the next free number (likely 0.2.110, after #553 and #557) in the file and the title when I merge.

A small note, no change needed: the width comes from the scale the script would seed, not the user's own monitors.lua, so someone who chose scale 2 still gets the scale-3 factor. Any factor at or under 0.83 fits, so that's fine; maybe say "the seeded scale" in the comment.

And yes, I'd welcome the same panel-based factor for Chromium as a follow-up.

@derekross
derekross merged commit 7494b8d into derekross:main Nov 9, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
)

* omamobile-shell 0.2.107: Grok Bot fits the phone's screen

Grok Bot (grok-bot from [omarchy], x.ai's agent, an Electron app) sets
a minimum window size of 512x520 (SAND_MIN_WINDOW_SIZE in its main
process). The Pixel 7 Pro is 480 px wide in logical pixels, so the app
laid itself out 512 px wide inside a 480 px window and ran off the right
edge: the ends of messages, the header buttons and the composer's
microphone were cut off. Chromium had the same problem and setup-user
gives it --force-device-scale-factor=0.83.

setup-user now does the same for Grok Bot, whose launcher reads
~/.config/grok-bot-flags.conf. The factor comes from the panel's mode
(the DSI connector in /sys/class/drm) and the monitor scale setup-user
seeds, so the layout gets about the 578 px Chromium gets on the 7 Pro:
0.83 on the 7 Pro (480 px), 0.70 on the 9a (405 px), 0.62 for a
1080 px panel at scale 3 (360 px), where 0.83 would leave 434 px, still
under 512. With no readable mode it falls back to 0.83. Once, and a
factor the user's file already has stays theirs.

Tested on a Pixel 7 Pro (Omarchy 4.5.0-3, omamobile-shell 0.2.100):
the factor by hand made the window fit (screenshots before and after);
the new step, run alone on the phone against a scratch home, read
1440x3120 and wrote 0.83. test/setup-user.sh covers the 7 Pro, the 9a,
a 1080x2400 panel, no mode, a user's own factor and two logins; its
first new check fails against the old script.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TTVicoVA5YdXzobkXGujF9

* omamobile-shell 0.2.108: renumber above main's 0.2.107 (derekross#420)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Derek Ross <derekross@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants