AppImage / appimagetool

A low-level tool to generate an AppImage from an existing AppDir
75 stars 13 forks source link

Processing AppImageTool terminal output #56

Closed Sadi58 closed 1 month ago

Sadi58 commented 2 months ago

I have a shell script which lets me right click a folder, and choose "Build AppImage" run AppImageTool to create an AppImage. I also tried to incorporate a GUI version of the progress status seen in terminal, but I couldn't capture it by piping and processing the terminal output with a command like "appimagetool '$1' 2>&1 | mawk -W interactive '/^[.] [0-9]+\/[0-9]+ +[0-9]+%$/ { gsub(/\%/, ""); print \$NF }'`. In this way, I can only capture two values: a random value between 1-99%, followed by 100%. I wonder if there's a reasonably easy way of capturing this value incrementally from 1% to 100%.

probonopd commented 2 months ago

Can you describe your use case? I am curious because appimagetool is hardly useful alone. It is meant to be used by higher-level tools in build pipelines.

TheAssassin commented 2 months ago

I don't intend to make appimagetool's logging machine readable. This is a very rare edge case.

Sadi58 commented 2 months ago

I use some AppImages with a little bit customization like changing icons, especially the system tray icons sometimes might not quite fit into the global theme (e.g. a color icon instead of a monochrome icon for light or dark themes). So, I unpack it to a folder, change the icons, and then repack it, all with just a right-click in the file manager. Unpacking is very quick, but repacking the folder to AppImage file format takes some time, and I thought it would be nice to add a progress bar into the shell script.

In some other similar cases I just needed to stop buffering and/or replace carriage returns with linefeeds to capture all terminal progress bar data, but these two methods didn't work with appimagetool. Yes, this might be a very rare use case, and I understand if you don't want ot spend some extra time/effort for it.

probonopd commented 1 month ago

Thanks @Sadi58 for your explanation. Currently we are focusing on tools that help application developers produce official AppImages for their applications.

TheAssassin commented 1 month ago

It's such a niche feature, it doesn't justify spending time on it. The tool works without a progress bar, too.

probonopd commented 1 month ago

Yes, can use something like a spinner instead.