vikdevelop/SaveDesktop

Export for Flatpaks

Vovkiv opened this issue · 6 comments

Vovkiv commented

(related to #40)
While i understand reasoning behind, i still want encourage you to implement exporting list of flatpak apps.
Apps (especially flatpak apps) is essential part of desktop, so storing list of them can be considered as part of DE.
Think of them as GNOME extensions, which is not really part of GNOME DE, but program saves them anyway.

SaveDesktop could export list of flatpaks like this flatpak list --app --columns=origin (if there flatpaks available to begin with)
And when importing from file done, it could copy to clipboard list as:

flatpak install -y a
flatpak install -y b
flatpak install -y c
flatpak install -y e

So user will be able to insert it into terminal and install.
Or, if there was backup of flatpak apps, it can show flatpak button which also copy this list to clipboard.
image

In any case, nice app.

Hello, from what I've tried, with the org.freedesktop.Flatpak permission, it's not really a problem to list the applications and then write them to a file. The problem would be with installing flatpak apps from that list, it's a fairly long process, however when importing the configuration the user has to log out to successfully apply the changes anyway, so after logging back in the apps could be installed in the background. So, I will try to implement it, but I am not sure, if it will be worked.

Vovkiv commented

Well, as i say, if this app will be able to export flatpaks list and then copy it to clipboard (so user can open terminal, past it and then press enter) at importing process, it will be already 100% much better.
Problem that i here see is not about how to install flatpaks, but rather how to get list of them. You see, programs like this exist for easing process of making backups. And considering, that this app also can periodically make backups, it's make things perfect.

Instead of hacky shell scripts, i just click "do backup, please" (and, optionally, "do backups everyday, please") and i'm done. But flatpaks also important thing (especially, when atomic OS's become more popular(like Fedora Silverblue or Vanilla OS) where most of apps supposed to be installed like flatpaks or snaps). And i, as any user, sometimes install and uninstall them.
Right now if i want to store somewhere up-to-day list of installed flatpaks, i need to manually flatpak list --app --columns=origin to file, then with some shell scripting i need to apply "flatpak install -y" to start for every item in list (so i can simply run that script without any additional keypresses). And THEN save file somewhere.
And i need to do this manually (or i could use, yet again, shell scripts, but why then bother with using app for that then?), instead of program that specifically designed to do such things!

In short, maintaining and exporting of flatpaks list is problem, not installing them, since you need to save them regularly while install maybe once a year when you, as user, accidentally broke system so you install fresh one and import setting and apps list.

Vovkiv commented

Also, this approach, not directly, but fixes issue that to import settings, you need to install SaveDesktop app in first place. And since backups is stored as tar file, you will be able to extract it (almost any DE and linux distro include zip archiver for that out-of-box), run .sh file with all flatpaks (where SaveDesktop also will be) to install them and then run this app and import other DE options. Sounds wonderful. (at least for me)

I implemented option of saving installed Flatpak apps. Just click on switch "Save installed Flatpak apps" and click on Save button. After saving configuration is available bash script installed_flatpaks.sh in the Tar archive. This option for now is not available in the stable build, but is available in the test build. If you want try it, use this commands:

git clone https://github.com/vikdevelop/SaveDesktop
cd SaveDesktop
flatpak-builder build *.yaml --install --user

In terms of periodic saving, SaveDesktop creates same bash script automatically. When importing configuration, SaveDesktop moves script to the app's data directory and after the next login, it runs on background and installs Flatpak apps. Of course, it is available option unzip Tar archive and run the bash script.

Vovkiv commented

I tested it and i already like it, thanks!

I uploaded on Flathub new version that has option for saving installed Flatpak apps. Sadly, with permission org.freedesktop.Flatpak flathub builder generates errors, so I decided use permission filesystem=/var/lib/flatpak:ro and edit some trifles. With this permission, SaveDesktop can create only list of apps, that installed to system directory (/var/lib/flatpak/app), not home directory (~/.local/share/flatpak/app).