Add pacplot script

This commit is contained in:
Anthony Wang 2021-12-03 08:49:14 -06:00
parent 28b0775be9
commit 5866de7915
Signed by: a
GPG key ID: BC96B00AEC5F2D76

25
pacplot Executable file
View file

@ -0,0 +1,25 @@
#!/usr/bin/env python3
from datetime import datetime
from matplotlib import pyplot as plt
with open('/var/log/pacman.log', 'r') as f:
cnt = 0
x = []
y = []
for line in f.readlines():
if 'PACKAGEKIT' in line:
continue
if 'installed' in line:
cnt += 1
elif 'upgraded' in line:
pass
elif 'removed' in line:
cnt -= 1
else:
continue
x.append(datetime.fromisoformat(line[1:23] + ':00'))
y.append(cnt)
plt.scatter(x, y)
plt.show()