20 lines
499 B
Python
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
|