Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1import subprocess
2from pi3bar.plugins.base import Plugin
5class Uname(Plugin):
6 """
7 :class:`pi3bar.app.Pi3Bar` plugin to show *uname* output.
9 :param full_param: :class:`str` - *uname* parameter
10 :param short_param: :class:`str` - *uname* parameter, short version
12 Examples:
14 .. code-block:: python
16 Uname()
18 # Show output of `uname -a`
19 Uname(full_param='a')
20 """
21 def __init__(self, full_param='r', short_param='r', **kwargs):
22 self.full_param = full_param
23 self.short_param = short_param
25 self.instance = full_param
27 self.full_text = subprocess.check_output(['uname', '-%s' % full_param]).decode().strip()
28 self.short_text = subprocess.check_output(['uname', '-%s' % short_param]).decode().strip()
29 super(Uname, self).__init__(**kwargs)