Support auracle as an update backend (#669)

This commit is contained in:
Raphael Scholer 2018-12-03 12:38:14 +01:00 committed by enkore
parent 55f8812bc9
commit 82f9548a2c

View File

@ -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))