2017-01-12 15:56:32 +02:00
|
|
|
import plugins
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
2019-03-28 12:21:15 +02:00
|
|
|
PACMAN_DEFAULTS = {
|
2019-10-28 10:57:51 +02:00
|
|
|
'cmd': ('/usr/bin/echo', 'I am cmd'),
|
|
|
|
'title': 'CMD', 'freq': 15
|
2019-03-28 12:21:15 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-01-12 15:56:32 +02:00
|
|
|
class PluginThread(plugins.PluginThreadCommon):
|
2017-12-16 01:55:28 +02:00
|
|
|
def __init__(self, config):
|
2019-03-28 12:21:15 +02:00
|
|
|
super(PluginThread, self).__init__(config, PACMAN_DEFAULTS)
|
2017-01-12 15:56:32 +02:00
|
|
|
|
|
|
|
def main(self):
|
2019-01-16 13:46:52 +02:00
|
|
|
pacman_qu = subprocess.Popen(
|
2019-03-21 14:17:38 +02:00
|
|
|
self.conf['cmd'], stdout=subprocess.PIPE,
|
2019-02-28 18:00:49 +02:00
|
|
|
stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
|
|
|
|
encoding='UTF-8'
|
2019-01-16 13:46:52 +02:00
|
|
|
)
|
2019-10-28 10:57:51 +02:00
|
|
|
out = pacman_qu.communicate()[0].strip().splitlines()[0]
|
2019-07-08 14:19:05 +03:00
|
|
|
|
2019-10-28 10:57:51 +02:00
|
|
|
self.format_status(out)
|