Skip to content

omamobile-settings 0.1.1: a Display page, brightness and refresh rate - #628

Merged
derekross merged 4 commits into
derekross:mainfrom
Somnius:settings-display-1110
Nov 11, 2026
Merged

derekross merged 4 commits into
derekross:mainfrom
Somnius:settings-display-1110

Conversation

@Somnius

@Somnius Somnius commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

@derekross, @marselnenaj, this is a first page for the Settings app on the foundation that just merged (#526), following the decision there that pages live in the app. It's the Display page: brightness in steps of 10, 25, 50, 75 and 100 percent, and the refresh rate, which lists the rates the built-in monitor offers at its current size and applies the tapped one live. The rate buttons are hidden if there is only one rate. The rate changes the running session only, so a restart or a config reload sets the configured mode again. The page opens with org.omamobile.Settings.Open("display").

The Display page

How it works: the page runs backends/display.sh through a small ActionRunner. The runner has a fixed list of tools, at most three arguments of lowercase letters and digits, no shell string, a 20 s kill, and it hands the one line of JSON back from the event loop. Brightness goes through brightnessctl on the device omarchy-hw-display names, the same as the shell's keys. The refresh rate uses hyprctl eval hl.monitor{...} with the monitor's own name, size, position, scale and transform, and the values read from hyprctl are checked before they get anywhere near the eval string. The monitor is the built-in panel (DSI or eDP), else the only one, else the focused one. Without a monitor the brightness still works.

The package now also depends on brightnessctl, python and bash. The version is 0.1.1, and the README says what the page changes. I kept the PIN and haptics pages out of this one on purpose; they would each be their own PR.

What I tested, on a Pixel 8 Pro: test/all passes on the phone, with a new test for the backend that fakes the monitor and the brightness (two monitors, one rate, a bad monitor name, no monitor). The page renders. 60 and 120 Hz both apply and read back, and a rate the monitor doesn't list is refused. A tap on 50% changed the backlight when the app was started by the compositor. Started from an ssh login it said it couldn't set the brightness, because logind refuses the call there, so that's how I launched it the first time and not a page problem.

What I didn't test: any other phone. Your 7 Pro would be the check, mainly that the rates list and the rotation survive a rate change. I haven't tried a rate change while the screen is rotated, and I don't know whether the success output of hyprctl eval is the same on every Hyprland version, so the script only looks for the word "error".

The first settings page on the foundation, opened as the display page
(org.omamobile.Settings.Open("display")). Brightness is the backlight
through brightnessctl, on the device omarchy-hw-display names, in steps of
10, 25, 50, 75 and 100 percent (never below 10). The refresh rate lists the
rates the built-in monitor offers at its current size and applies the one
tapped live, through hyprctl eval hl.monitor with the monitor's own name,
size, position, scale and transform; the page hides the rate buttons when
there is only one. It changes the running session only.

The page runs backends/display.sh through a small ActionRunner: a fixed
tool list, at most three arguments of [a-z0-9] up to 16 characters, no
shell string, a 20 s kill, and the result as one line of JSON delivered
from the event loop. Values taken from hyprctl are checked before they
reach the eval string.

Tested on a Pixel 8 Pro: test/all passes on the phone (the new backend
test included), the page renders, 60 and 120 Hz apply and read back, and
brightness changes when the app is started by the compositor (from an ssh
login the logind brightness call is refused, which is expected).
Not tested on any other phone.

Signed-off-by: Lef <me@lefteros.com>
@derekross

Copy link
Copy Markdown
Owner

@Somnius thank you for this, it's a good first page on the Settings foundation and a careful one. I read the runner, the backend and the page, and replayed the whole stack (#628, #629, #630) onto today's main: test/all passes there, including the new Back test that came in with #643. What I like: the runner takes a fixed list of tools and plain-word arguments with no shell string, every value from hyprctl monitors is checked before it reaches the eval, the rate must be one the monitor lists at its current size, the result is read back from the monitor rather than trusted, and the brightness never goes below 10 %. The page also goes back on Escape as every Settings page must since today (it is an ordinary catalog page and the window's Escape shortcut handles it), and from the top level Back goes home.

One thing has to change, and it is not your doing: #643 landed a few hours after you opened this and took omamobile-settings 0.1.1 (Back goes up one page, and home from the top level). Your branch has the same version line, so git sees no conflict and it would merge silently under a version that is already published. This one becomes 0.1.2; I'll set the file and the title when I merge, so no push is needed just for that, and #629 and #630 then take 0.1.3 and 0.1.4.

Smaller things, for this PR or the next push of the stack:

  • The rate is undone by a rotation. Auto-rotate (omamobile-sensors' autorotate.py) re-applies the monitor with mode = "preferred" each time the phone is turned, so a chosen 60 Hz lasts until then. The README and the script header only mention a restart or a config reload; please name rotation too, in the README and ideally in the page's status line. Making the choice stick is a separate change, since it touches what every phone runs.
  • A test for Back on the page: in tests/core_tests.cpp, navigate to display, call back(), expect root. Three lines, and the same for the other two pages in their PRs.

I haven't run it on the Pixel 7 Pro yet. Nothing installs Settings by default, so that doesn't hold the merge; I'll try the rate buttons there (60 and back to 120, a rotation, a lock and unlock) before Settings goes into an image and report here.

For the stack: once this is merged, please rebase the next one with git rebase --onto origin/main 6a2fb993e0 settings-haptics-1110 (a plain rebase would replay this commit against its own squash and conflict).

… Back on the Display page

Auto-rotate applies the monitor's preferred mode each time the phone is
turned, so a chosen rate lasts only until then: the README, the script
header and the page's status line say so. A core test goes to the display
page and back to the root.
@derekross

Copy link
Copy Markdown
Owner

@Somnius thank you, both points are in: the README, the script header and the page's status line now say that turning the phone brings the preferred rate back, and displayPageGoesBackToRoot covers Back on the page. Your merge of main is clean (it is exactly what git produces on its own, so nothing of #643 was lost), and CI passed on it.

I'm setting the version to 0.1.2 on your branch and merging it under that number, as promised. For the stack, once this is in: git rebase --onto origin/main 568d96c561 settings-haptics-1110 (the base moved with your last push), and #629 takes 0.1.3 and #630 0.1.4.

I still owe the run on my Pixel 7 Pro (60 and back to 120, a rotation, a lock and unlock) before Settings goes into an image, and I'll report it here.

@derekross
derekross merged commit a9b3adb into derekross:main Nov 11, 2026
2 checks passed
robertzas pushed a commit to robertzas/omarchy-mobile that referenced this pull request Nov 14, 2026
…derekross#628)

The Settings app gets its first page: brightness in fixed steps through brightnessctl, and the built-in panel's refresh rate applied live through `hyprctl eval` with every value from `hyprctl monitors` checked first. The page runs `backends/display.sh` through a fixed-argument runner with no shell string. The rate changes the running session only: a rotation, a session restart or a config reload brings the preferred mode back. Tested on a Pixel 8 Pro; not yet run on the Pixel 7 Pro.

Signed-off-by: Lef <me@lefteros.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