TUI (curses) interface for libreoffice?


I was just thinking about something: Would it be possible to make a TUI interface for libreoffice so that it could work similar to command line browsers like (e)links (with menus accessible via keyboard)? Bonus points if it would have different key binding “personalities” for different preferences (vim, emacs, nano, …).

I think this could be quite nice since you could both read and edit documents without an X11/wayland session (could be a competitor to pandoc etc as document reader for users of CLI e-mail clients like mutt).

Some people also prefer TUI to richer GUIs since it is a more distraction-free environment (the most famous example is probably George RR Martin who reportedly writes his books with WordStar 4.0 on DOS …).

Several solutions for viewing documents in plain text are described at command line - Tool for viewing LibreOffice Writer files in terminal window - Ask Ubuntu, including my answer:

libreoffice --cat “Untitled 1.odt” --headless | less

This produces plain text.

LibreOffice text uses graphical rendering engines such as HarfBuzz and graphite. I don’t think that would be possible in a terminal. And without that rendering, the document will look significantly different.

You could write a TUI viewer for the ODT format. It’s a zip file, and most of the important information is stored in content.xml. Your application could use LibreOffice to convert files to ODT first for reading, to handle other formats such as DOC, DOCX, RTF and so on.