You can use Python to create a gnome extension that shows memory use. (Gnome is quite a memory eater).
See that little memory icon with the percentage use? That's what we'll build.
If you have the memory problem with gnome, the lazy fix for this is not to tweak gnome, but to add a more ram memory.
To create gnome extensions in Python, you can use argos. An extension that lets you use Python to create your extension
So first install the argos extension and enable it in gnome-tweak-tool. This extension is in the default ubuntu repo.
The extension can be refreshed, by setting the filename
would referesh every 3 seconds.
would refresh every 6 seconds.
Now we type a few lines of Python. The module psutil can give you the current memory use.
#!/usr/bin/python import os import psutil print( str(psutil.virtual_memory()) + "% | iconName=gnome-dev- memory") print("---") print("Use: " + str(psutil.virtual_memory()) + "%") print("---")
Save it in ~/.config/argos
Make sure to
chmod +x your_script.py
Then it will show the memory right in your top bar! :D