Formatting piped text in zenity
Asked Answered
U

1

5

I'm trying to show some mediainfo output in a Zenity dialog, using

mediainfo 00000.MTS | zenity --text-info
and here's there result. As the image shows, the text is badly formatted because of spaces, while it shows just right in terminal.

Can I change this? Also, is it possible to format particular strings of text (e.g: the "General" and "Video" headers)?

Unification answered 20/10, 2014 at 18:8 Comment(0)
K
7

the text is badly formatted because of spaces, while it shows just right in terminal. Can I change this?

Yes, just change the font to one that is monospaced:

mediainfo 00000.MTS | zenity --text-info --font='DejaVu Sans Mono'

is it possible to format particular strings of text

No, this is not possible with --text-info.

Kliment answered 2/11, 2014 at 15:26 Comment(2)
I wonder why this got downvoted. It looks to me as a good answer. +1Ripply
FYI, as of version 3.14.0 of zenity, the depicted font option does not appear to be available when using zenity's --list format...Diaphragm

© 2022 - 2024 — McMap. All rights reserved.