@@ -0,0 +1,1102 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%0Aimport subprocess%0Afrom subprocess import CalledProcessError%0Afrom subprocess import DEVNULL%0A%0Afrom i3pystatus import IntervalModule%0A%0Aclass PidofWatch(IntervalModule):%0A  %22%22%22%0A  Use pidof command to check whether target process running.%0A  .. rubric:: Available formatters%0A%0A  * %7Bname%7D%0A  %22%22%22%0A%0A  format_up = %22%7Blabel%7D%22%0A  format_down = %22%7Blabel%7D%22%0A  color_up = %22#00FF00%22%0A  color_down = %22#FF0000%22%0A  label = %22%22%0A  settings = (%0A    %22format_up%22, %22format_down%22,%0A    %22color_up%22, %22color_down%22,%0A    %22name%22, %22label%22,%0A  )%0A  required = (%22name%22,)%0A%0A  def run(self):%0A    alive = False%0A    try:%0A      subprocess.check_call(%5B%22pidof%22, %22vsftpd%22%5D, stdout=DEVNULL, stderr=DEVNULL)%0A    except CalledProcessError:%0A      alive = False%0A    else:%0A      alive = True%0A%0A    if alive:%0A      fmt = self.format_up%0A      color = self.color_up%0A    else:%0A      fmt = self.format_down%0A      color = self.color_down%0A%0A    if self.label == %22%22:%0A      self.label = self.name%0A%0A    self.output = %7B%0A        %22full_text%22: fmt.format(label=self.label),%0A        %22color%22: color,%0A        %22instance%22: self.label%0A    %7D%0A

Add pidof_watch