Skip to content

omarchy-mac: keep a symlinked browser flags file linked and patch its target - #125

Closed
only21mil wants to merge 4 commits into
omacom:mainfrom
only21mil:browser-flags-keep-symlink
Closed

only21mil wants to merge 4 commits into
omacom:mainfrom
only21mil:browser-flags-keep-symlink

Conversation

@only21mil

@only21mil only21mil commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Problem

User setup turns AcceleratedVideoDecoder off in each Chromium-family *-flags.conf, so Brave and other VA-API builds stop rendering green frames through the Apple Video Decoder. When the file already has a --disable-features= line, setup joins the feature to it with sed -i.

GNU sed -i writes a new regular file and renames it over the path, so a symlinked brave-flags.conf, such as one stow links in, silently becomes a plain copy: dotfiles edits no longer reach the browser, and the next stow --restow stops on the plain file. The first run appends through the link with >>, but later runs find the line setup wrote, so a second browser install detaches the first one's flags.

Change

  • For a symlinked flags file, omarchy-mac-setup-user writes the joined list through the link, as it already appends through it: the link stays and its target gets the edit, only when the list changes. A plain file still takes sed -i, and a dangling link is still skipped.
  • A link whose target the user cannot write is left as it is, with a message. Say if you would rather replace it.
  • A new integration test runs the runtime's flags copy and post-install dispatch for Brave, then for Chromium.
  • The omarchy-mac README's user-setup paragraph says both. omarchy-mac/version does not change: since Bump omarchy-mac's version only in a release's own pull request #30, only a release PR changes it.

Scope

A bug fix in omarchy-mac's own user setup: it turns a symlinked browser flags file into a plain copy. No issue is linked; the tests below show the bug.

Verification

Setup. AI agent checks on an x86_64 Linux desktop (Ubuntu 26.04, GNU sed 4.9), each run in a fresh home with the runtime at its pin.

Steps. Run both changed tests → read the exit status.

Before, main 95b0dd9 with only the new tests added, both fail, exit 1:

not ok - a linked flags file stays a link regular file
not ok - a linked flags file stays a link through later browser installs

After, this branch at f481971, which merged main 091a106, both pass, exit 0. Merged locally with main 95b0dd9, cleanly, they print the same:

ok - Chromium-family browsers decode in software on Apple Silicon, once, joining existing lists, through a symlink too
ok - browser installs keep a dotfiles-linked flags file a link and turn hardware decode off in its target

Links. The regression test; #30, #72.

Not shown

  • A Mac with a stow-managed brave-flags.conf; the tests stage a relative link the way stow makes one.
  • A real read-only store or mount; the tests make a directory and a file the test user owns read-only with chmod.

Prior PRs

None make this change.

Unedited runs and detail

Main 95b0dd9 with only the new tests added fails both:

# main 95b0dd9, new tests only, runtime at its pin 2fca7fe
$ bash omarchy-mac/test/desktop-setup-test.sh
ok - the setup entrypoints, platform files and Electron helpers are staged
ok - system setup wraps each installed Electron app, keeping administrator-owned launchers, and skips a runtime without the helpers
ok - user setup points desktop entries at ready wrappers only
ok - user setup writes nothing into the user's input.lua
not ok - a linked flags file stays a link regular file
# exit 1
$ OMARCHY_TEST_RUNTIME=<omarchy at test/integration/runtime> bash test/integration/browser-flags-dotfiles-test.sh
regular file
not ok - a linked flags file stays a link through later browser installs
# exit 1

This branch at f481971 passes both, and so does its local merge with main 95b0dd9, with the same output:

# f481971, runtime at its pin 81fd2d2
$ bash omarchy-mac/test/desktop-setup-test.sh
ok - the setup entrypoints, platform files and Electron helpers are staged
ok - system setup wraps each installed Electron app, keeping administrator-owned launchers, and skips a runtime without the helpers
ok - user setup points desktop entries at ready wrappers only
ok - user setup writes nothing into the user's input.lua
ok - Chromium-family browsers decode in software on Apple Silicon, once, joining existing lists, through a symlink too
Deferring speaker safety: speakersafetyd is not installed
ok - the lifecycle entrypoints run the Mac system and user setup
ok - system setup installs the Steam FEX launcher wherever Steam is, online and only on Apple Silicon
ok - user setup prepares Steam for the FEX launcher where the user has Steam
# exit 0
$ OMARCHY_TEST_RUNTIME=<omarchy at test/integration/runtime> bash test/integration/browser-flags-dotfiles-test.sh
ok - browser installs keep a dotfiles-linked flags file a link and turn hardware decode off in its target
# exit 0

Other checks, by the AI agent on f481971 and on its local merge with main 95b0dd9:

What the tests check.

  • omarchy-mac/test/desktop-setup-test.sh: a relative link, as stow makes, to a dotfiles copy that already has --disable-features=SomeOtherThing is still a link after setup, and the target gains AcceleratedVideoDecoder. A second run with nothing to change leaves the target's mtime as it was. A link whose target has no --disable-features= line yet is still a link after setup, and the target gains the line. The joined case also holds with the dotfiles directory read-only, on a first run and on a second run with nothing to change. A link to a read-only file is left as it is, setup says so and exits 0. A dangling link is left dangling and setup exits 0. A plain flags file stays a plain file.
  • test/integration/browser-flags-dotfiles-test.sh, with OMARCHY_TEST_RUNTIME at the test/integration/runtime pin: omarchy-install-browser's own flags copy, then the real omarchy-lifecycle-dispatch post-install into omarchy-mac as its install script stages it. The dotfiles directory is read-only for the second install. After both installs Brave's flags file is still a link, its target turns hardware decode off once, and Chromium's plain file is edited in place.

Mutations that fail the tests, run on f481971: sed -i for a link too, as on base; sed -i --follow-symlinks for a link, as on this PR's first commit 415e848; a rename of the joined file over the link name; no check for a target that cannot be written; exiting with an error after leaving such a target; rewriting the target when nothing changes; appending by replacing the link with a plain file; and faking an x86 platform so dispatch does nothing.

More detail.

Merge Danger. Door: two-way. Blast Radius: symlinked browser flags files. Plain flags files take the same sed -i as before.

Generated with Claude Opus 5.5 in T3 Code Nightly

…its target

User setup checked each Chromium-family flags file with -f, which follows a symlink, then joined AcceleratedVideoDecoder to an existing --disable-features list with GNU sed -i. sed -i writes a new regular file over the link name, even when nothing changes, so a flags file that a dotfiles manager such as stow links in lost its link on the first run that found a --disable-features line, including the one setup had appended itself, and installing a second browser was enough. The dotfiles copy was no longer the file in use, and the next restow brought back whatever it held. sed now runs with --follow-symlinks and edits the link's target. The append branch already wrote through the link with >>.

A dangling link still fails -f and is left alone, and a plain file is still edited in place. desktop-setup-test covers a relative link, as stow makes, plus the dangling link and the plain file. A new integration test installs Brave and then Chromium the runtime's way, with omarchy-install-browser's own flags copy and the real omarchy-lifecycle-dispatch post-install into the staged package, and checks that Brave's linked flags file is still a link. The README says a symlinked flags file stays a link, and the version moves to 0.2.7.
sed -i --follow-symlinks kept the link, but it makes its temporary file beside the link's target. A target in a directory the user cannot write stopped user setup with sed's exit 4, even when the list already had the feature, and the rest of setup (the other flags files, the microphone, Steam, the desktop entries) never ran. Base went on there, replacing the link.

For a link, setup now writes the joined list through the link, as the append branch always has. The target keeps its inode, mode and hard links, and its directory need not be writable. A link whose target the user cannot write is left as it is, with a line saying so, in both branches; base replaced such a link with a plain copy in the join branch and stopped in the append branch. A plain file takes sed -i as before.

desktop-setup-test covers a link into a read-only directory, run twice, and a link to a read-only file. The integration test makes the dotfiles directory read-only before the second browser install. The README says a target the user cannot write is left as it is.
Takes main's omarchy-mac/version and README version line, since main now lets only a release pull request change the version.
… unwritten

User setup rewrote a linked flags file's target on every run, even when the joined list matched it, so each run truncated and rewrote the user's dotfile and moved its mtime. It now compares the joined list with the target first and writes only when they differ. The joined list's temporary file is removed when sed or the write fails too, and setup still exits with that command's status.

desktop-setup-test checks that a run with nothing to change leaves the target's mtime alone, and covers a link whose target has no --disable-features line yet: the link stays a link and its target gains the line.
@only21mil
only21mil force-pushed the browser-flags-keep-symlink branch from da314bb to f481971 Compare November 21, 2026 02:01
@only21mil

Copy link
Copy Markdown
Contributor Author

I'm closing this to keep my open PRs focused on active maintainer priorities and higher-impact fixes.

@only21mil only21mil closed this Nov 28, 2026
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.

1 participant