Hide keyboard shortcuts

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 

3 

4 

5class Uname(Plugin): 

6 """ 

7 :class:`pi3bar.app.Pi3Bar` plugin to show *uname* output. 

8 

9 :param full_param: :class:`str` - *uname* parameter 

10 :param short_param: :class:`str` - *uname* parameter, short version 

11 

12 Examples: 

13 

14 .. code-block:: python 

15 

16 Uname() 

17 

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 

24 

25 self.instance = full_param 

26 

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)