Hello guys, I recently made a bash script to try out auto-updates in flatpak.
Flatpak don't do auto updates and thinking about this post I thought, is it possible with flatpak? every time a have to update flatpaks that I use, I have to go to open the terminal type the command and wait for it to finish. Burning my brain for a few days now (I had no experience before) I made a bash script, using flatpak
to run the updates and pgrep
and notify-send
to get some feedback.
#/bin/sh
icon="-i package-x-generic-symbolic"
runing=$(pgrep flatpak)
if [ $runing <> 0 ]; then
notify-send $icon Faltpak "Flatpak is already running"
else
notify-send $icon Flatpak "Searching and applying updates"
flatpak --user -y update
status=$(echo $?)
if [ $status -eq 0 ]; then
notify-send $icon Flatpak "Flatpaks are up to date"
else
notify-send $icon Flatpak "There were an error updating"
fi
fi
I know it could be optimized to get a few lines less, what do you think? and what can be improve?
I think it's a neat quality of life improve.