i3pystatus/i3pystatus/updates/pacman.py
Lukáš Mandák 7d48a00b1e Updated docs.
2015-06-02 22:49:12 +02:00

20 lines
499 B
Python

from i3pystatus.core.command import run_through_shell
from i3pystatus.updates import Backend
class Pacman(Backend):
"""
Checks for updates in Arch Linux repositories using the
`checkupdates` script which is part of the `pacman` package.
"""
@property
def updates(self):
command = ["checkupdates"]
checkupdates = run_through_shell(command)
out = checkupdates.out.strip()
return len(out.split("\n")) if len(out) > 0 else 0
Backend = Pacman