show only real mem useage without swap
removed swap size from showed memory
This commit is contained in:
parent
9b5a12bd0c
commit
fb1d3e9199
@ -7,7 +7,7 @@ __version__ = '1.0.0'
|
|||||||
__name__ = 'memtemp'
|
__name__ = 'memtemp'
|
||||||
__license__ = 'GPL3'
|
__license__ = 'GPL3'
|
||||||
__description__ = 'A plugin that will add a memory and temperature indicator'
|
__description__ = 'A plugin that will add a memory and temperature indicator'
|
||||||
__enabled__ = False
|
__enabled__ = True
|
||||||
|
|
||||||
import struct
|
import struct
|
||||||
|
|
||||||
@ -39,7 +39,10 @@ class MEMTEMP:
|
|||||||
|
|
||||||
def get_mem_info(self):
|
def get_mem_info(self):
|
||||||
try:
|
try:
|
||||||
total, used, free = map(int, os.popen('free -t -m').readlines()[-1].split()[1:])
|
# includes RAM + Swap Memory:
|
||||||
|
# total, used, free = map(int, os.popen('free -t -m').readlines()[-1].split()[1:])
|
||||||
|
# without Swap, only real memory:
|
||||||
|
total, used, free = map(int, os.popen('free -t -m').readlines()[-3].split()[1:4])
|
||||||
return "tm:"+str(total)+" um:"+str(used)+" fm:"+str(free)
|
return "tm:"+str(total)+" um:"+str(used)+" fm:"+str(free)
|
||||||
except:
|
except:
|
||||||
return "tm:0 um:0 fm:0"
|
return "tm:0 um:0 fm:0"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user