Is it possible to get the installation progress or removal of a snap with the process running in backgroud?


#1

Hello,

I would like to pass the install or uninstall progress of a Snap application to zenity, to do something like the example below:

sudo snap remove brave | (pv -n > snap2) 2>&1 | zenity --progress --width 350 --percentage=0 --text "Installing Fusion..." --title "Installation in progress" --auto-close --auto-kill --no-cancel

When running the above command on the Terminal, everything works as expected, with the Snap passing all the process information to zenity, which in turn displays a test ticket showing the installation or removal time of the application.

However, when running in the background using, for example, another graphical application running this command above, Snap seems to hide all progress, displaying only the completion of the process, that is, whether the application was installed or removed.

Is there a way to enable the Snap progress with it running in the background?


#2

not explicitly (although we might add that at some point, if there’s enough demand). Meanwhile, you could arrange it so that snap's standard input is a tty. This will have it use the full progress bar.


#3

OK. Thank you so much for your answer. :smiley:

Update:

To make this work I used: script -q -c ‘snap command here’

This allows me to capture the snap output, even if it is running in the background, to display, for example, a progress bar with zenity.


#4

Thank you @josue63, this really helped me a lot.