GitHub - WhiskeyTuesday/omawrite-win: why? · GitHub
/" data-turbo-transient="true" />
Skip to content
Search/
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
WhiskeyTuesday
omawrite-win
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
master
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>1 Commit<br>1 Commit
screenshots
screenshots
.gitignore
.gitignore
Dockerfile.mingw
Dockerfile.mingw
README-test.md
README-test.md
README.md
README.md
build-windows.sh
build-windows.sh
deploy.py
deploy.py
install.cmd
install.cmd
make-sfx.sh
make-sfx.sh
run-wine.sh
run-wine.sh
set-dark.cmd
set-dark.cmd
set-light.cmd
set-light.cmd
windows-port.patch
windows-port.patch
View all files
Repository files navigation
omawrite-win
My name is Ozymandias, King of Kings;<br>Look on my Works, ye Mighty, and despair!<br>Nothing beside remains.
Cross-compiles omawrite — the markdown<br>editor that ships with Omarchy 4 "Quattro" — for Windows.
Nobody asked for this but here it is anyway. Claude wrote the rest of this<br>README and I'm not going to bother removing all the em-dashes and stuff. Enjoy!
The disappointing part
It was easy.
The entire port is 42 lines , and 30 of those are #ifndef. Not one line of<br>the editor, the syntax highlighter, or any QML needed to change. It builds in<br>about fifteen seconds.
The only platform-specific code in the whole application was the<br>xdg-desktop-portal block in src/systemtheme.cpp and that already had a<br>Qt-native fallback sitting directly underneath it, because Qt reports the<br>system colour scheme via QStyleHints::colorScheme() on every platform. So the<br>"port" is mostly deleting a D-Bus call and letting the code that was already<br>there do its job. QProcess, QSaveFile, QStandardPaths, and the print<br>pipeline are all portable as written.
The mildly interesting part
You do not need to build Qt.
Every guide to cross-compiling Qt for Windows from Linux opens by telling you to<br>spend several hours compiling Qt for Windows from Linux. You don't have to.<br>Fedora's mingw SIG ships the entire stack prebuilt — mingw64-gcc-c++,<br>mingw64-qt6-qtbase, mingw64-qt6-qtdeclarative, the lot — so the toolchain is<br>a dnf install in a container and nothing but your own code ever gets compiled.
The one gap is that Fedora doesn't package windeployqt, so deploy.py stands<br>in for it: walk the PE import table with objdump -p, resolve each name against<br>the sysroot, recurse until the closure is complete. About 60 lines. It works.
dist/ (~109M folder)<br>./make-sfx.sh # -> two single-file .exe wrappers (~26M each)">./build-windows.sh # -> dist/ (~109M folder)<br>./make-sfx.sh # -> two single-file .exe wrappers (~26M each)
Docker is the only requirement. The first script clones upstream, applies the<br>patch, builds the image, cross-compiles, deploys the runtime, and strips it.
make-sfx.sh produces two flavours:
omawrite-portable.exe<br>Unpacks to %TEMP%, runs, cleans up. Installs nothing.
omawrite-setup.exe<br>Unpacks once to %LOCALAPPDATA%, makes shortcuts, launches.
Portable pays the unpack cost on every launch, which is fine for a look and<br>tiresome as a daily editor. Neither passes file arguments through, so<br>double-clicking a .md won't route to it; the installed copy is a normal .exe<br>and will.
There's also run-wine.sh, which drives the build under Xvfb + wine and<br>screenshots it, because I wanted to know whether it worked before I had anywhere<br>to run it.
Does it actually work
I tested it on a real Windows 11 VM not just wine (but nothing else):
Launch, DLL + QML closure<br>works
Open / Save / Ctrl+S<br>works
Print to PDF<br>works
Dark / light following the OS<br>works
Ctrl+N (new window)<br>works
Print is worth a note, because it's the only place omawrite does real<br>markdown rendering — it builds a fresh QTextDocument and calls setMarkdown(),<br>so the PDF has actual heading hierarchy. The editor itself never does this. It's<br>a syntax highlighter over raw text: block markers like # stay visible but<br>dimmed, and inline markers like ** are hidden by painting them in the<br>background colour at 1pt with negative letter-spacing so they collapse to zero<br>width. Headings are bolded, never resized. It's a nice effect and it is not<br>WYSIWYG.
Size
165M → 26M.
strip --strip-unneeded on everything. Fedora ships those DLLs with full<br>debug symbols; libstdc++-6.dll alone was 25M.
Dropped the four Controls styles omawrite never imports (FluentWinUI3,<br>Imagine, Universal, Fusion).
LZMA2 solid-block at -mx=9.
The floor is Qt. icudata74.dll is 30M on its own and only a static rebuild<br>with -no-icu removes it, which costs hours of compiling to save a folder you<br>were going to...