Read more

Simple memory information widget for the Xfce panel (or anywhere else where you can run a shell command)

Arne Hartherz
December 06, 2012Software engineer at makandra GmbH

I was unsatisfied with the existing memory status applets for the Xfce panel, so I wrote a little shell script that shows me just the information I need. Now I use it via a "Generic Monitor" panel applet.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

Put this at some place like ~/bin/memory-info and chmod +x it:

#!/bin/sh
meminfo=`free -m | grep 'Mem:'`

used=`echo $meminfo | cut -d" " -f3`
total=`echo $meminfo | cut -d" " -f2`
cached=`echo $meminfo | cut -d" " -f7`

really_used=`expr $used - $cached`

echo "Memory usage: $really_used / $total (Cached: $cached)"

Next, add a "Generic Monitor" applet to your Xfce panel, fill in the name of the file you just created and set a refresh time that suits you (like 3 seconds). Done.

Posted by Arne Hartherz to makandra dev (2012-12-06 11:07)