def play(self):
        """Play music if stopped, else toggle pause."""
        if self.status in ("PLAY", "PAUSE"):
            subprocess.Popen(["mocp", "-G"])
        elif self.status == "STOP":
            subprocess.Popen(["mocp", "-p"])
Play music if stopped, else toggle pause.
libqtile/widget/moc.py