blob: 839dffe81cd86f69ca1359d037e4512f5192e49b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
import plugins
import subprocess
PACMAN_DEFAULTS = {
'cmd': ('/usr/bin/echo', 'I am cmd'),
'title': 'CMD', 'freq': 15
}
class PluginThread(plugins.PluginThreadCommon):
def __init__(self, config):
super(PluginThread, self).__init__(config, PACMAN_DEFAULTS)
def main(self):
pacman_qu = subprocess.Popen(
self.conf['cmd'], stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL, stdin=subprocess.DEVNULL,
encoding='UTF-8'
)
out = pacman_qu.communicate()[0].strip().splitlines()[0]
self.format_status(out)
|