DEV Community

Cover image for Gnome memory monitor extension

Posted on

Gnome memory monitor extension

You can use Python to create a gnome extension that shows memory use. (Gnome is quite a memory eater).

top bar

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.

Enter the matrix

Now we type a few lines of Python. The module psutil can give you the current memory use.

import os
import psutil

print( str(psutil.virtual_memory()[2]) + "% | iconName=gnome-dev- memory")
print("Use: " + str(psutil.virtual_memory()[2]) + "%")

Save it in ~/.config/argos

Make sure to

chmod +x

Then it will show the memory right in your top bar! :D

top bar


Top comments (0)