From 82f9548a2c0a2072c163392f3b7ccf0c63296698 Mon Sep 17 00:00:00 2001 From: Raphael Scholer Date: Mon, 3 Dec 2018 12:38:14 +0100 Subject: [PATCH] Support auracle as an update backend (#669) --- i3pystatus/updates/auracle.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 i3pystatus/updates/auracle.py diff --git a/i3pystatus/updates/auracle.py b/i3pystatus/updates/auracle.py new file mode 100644 index 0000000..8f40a1e --- /dev/null +++ b/i3pystatus/updates/auracle.py @@ -0,0 +1,24 @@ +from i3pystatus.core.command import run_through_shell +from i3pystatus.updates import Backend + + +class Auracle(Backend): + """ + Checks for updates in Arch User Repositories using the `auracle` AUR helper. + + Depends on auracle AUR agent - https://github.com/falconindy/auracle + """ + + @property + def updates(self): + command = ["auracle", "sync"] + auracle = run_through_shell(command) + return auracle.out.count('\n'), auracle.out + +Backend = Auracle + +if __name__ == "__main__": + """ + Call this module directly; Print the update count and notification body. + """ + print("Updates: {}\n\n{}".format(*Backend().updates))