From dbeed0b7d814a7e245e42086f3c47c31c2db55d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1vid=20Groniewsky?= Date: Tue, 30 Sep 2025 22:40:19 +0200 Subject: [PATCH] Updated the README with the announcement that flatpaks can now be managed. Added the required documentation to the example. --- README.md | 3 +++ example/my_module.py | 4 ++++ example/source.py | 9 +++++++++ 3 files changed, 16 insertions(+) diff --git a/README.md b/README.md index cb0a932..39e945b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,8 @@ # Decman +> 🎉 Support for Flatpaks was just added! 🎉 +> By default flatpak management this feature is disabled. Take a look at the example to learn how to use flatpaks. + > 🎉 Decman now has a AUR package! 🎉 > > To start using the AUR package simply add `decman` to `decman.aur_packages`. To ensure a smooth change, add decman-git to ignored_packages during the conversion. diff --git a/example/my_module.py b/example/my_module.py index f99a453..193a34c 100644 --- a/example/my_module.py +++ b/example/my_module.py @@ -1,5 +1,6 @@ # from import is ok for importing classes and functions # just remember to not import variables this way +from typing import override from decman import Module, File, Directory, UserPackage, sh, prg @@ -112,6 +113,9 @@ class MyModule(Module): def aur_packages(self) -> list[str]: return ["protonvpn"] + def flatpak_packages(self) -> list[str]: + return ["org.mozilla.firefox"] + def systemd_units(self) -> list[str]: return ["reflector.timer"] diff --git a/example/source.py b/example/source.py index ecae193..0573298 100644 --- a/example/source.py +++ b/example/source.py @@ -12,6 +12,9 @@ import decman.config # This is fine since the thing being imported is a class and not a global variable. from decman import UserPackage, File, Directory, UserRaisedError +# Flatpaks are disabled by default. This way no already installed flatpaks will get suddenly deleted. +decman.config.enable_flatpak = True + # Configuring what packages are installed is easy. # Duplicates are OK, so if you have multiple modules that want to ensure a package is installed, # you can add the same package multiple times. @@ -28,6 +31,12 @@ decman.ignored_packages += ["rustup", "yay"] # Installing AUR packages is easy. decman.aur_packages += ["decman", "protonvpn"] +# Flatpaks work the same way as all other packages. +decman.flatpak_packages += ["dev.qwery.AddWater"] + +# They too can be ignored of course +decman.ignored_flatpak_packages += ["org.signal.Signal"] + # To import GPG keys, set the GNUPGHOME environment variable. # It can easily be done with python as well. os.environ["GNUPGHOME"] = "/home/kk/.gnupg/"