I want to set librewrite to write polytonic greek without changing xorg
Never tested it (I don’t know Greek), but I found this LibreOffice extension on GitHub:
But in principle you don’t need to set Writer nor modify Xorg to write in any script: you just need the right input method and a font that support the script. Install the correct keyboard layout (the details depend on your distro and desktop environment) and download an appropriated font, such as the ones offered by the Greek Font Society. It seems the OpenSource font Walleye(1) support polytonic Greek too and for sure there are others.
(1) I’ve wrote about Walleye here.