how to format multi-line command module output #1956
Replies: 3 comments 1 reply
-
You have to join them into a single line BYW there is a module that prints zpool info. It doesnt print datasets though. |
Beta Was this translation helpful? Give feedback.
-
I'm using the zpool mod already and thank you for that. I've converted the output so all json is a single line but the fields are not getting interpreted: $ ./fastfetch-zfs.sh {"zfsfs": "zroot/ROOT/arch-gnome", "zfsfsval": "Used 30.2G Snaps 5.71G DS 24.4G"}, {"zfsfs": "zroot/ROOT/arch-kde", "zfsfsval": "Used 46.9G Snaps 29.2G DS 17.6G"}, {"zfsfs": "zroot/ROOT/arch-proto", "zfsfsval": "Used 2.45G Snaps 2.91M DS 2.45G"}, {"zfsfs": "zroot/ROOT/debian-gnome", "zfsfsval": "Used 12.8G Snaps 4.66G DS 8.18G"}, {"zfsfs": "zroot/ROOT/debian-sid", "zfsfsval": "Used 35.5G Snaps 16.8G DS 18.8G"}, {"zfsfs": "zroot/homes/root", "zfsfsval": "Used 2.94M Snaps 1.43M DS 1.52M"}, {"zfsfs": "zroot/homes/toms", "zfsfsval": "Used 573G Snaps 25.4G DS 261G"}, {"zfsfs": "zroot/homes/toms/Games", "zfsfsval": "Used 287G Snaps 32.7M DS 287G"}, The config stanza: { "type": "command", "text": "/home/toms/bin/fastfetch-zfs.sh", "key": "{#90}│ {#91}ZFS DS {#90}│", "format": "{$1}{zfsfs} {zfsfsval}" }, |
Beta Was this translation helpful? Give feedback.
-
So it is not possible to format and display multiple lines of output using the command module? If I wish to format and display multiple zfs datasets I need to have a separate command stanza for each one? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
How can I format format the output of a command which returns multiple lines?
The result when printed is the first line of output will be formated but the remaining lines are not. I've even tried to generate json output and use the defined fields:
This ends up not displaying anything at all.
Is this even possible?
Beta Was this translation helpful? Give feedback.
All reactions