Skip to content

Instantly share code, notes, and snippets.

@cirrusUK
Created June 14, 2021 01:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirrusUK/8ff276a9242a24940ebdf2c56a972548 to your computer and use it in GitHub Desktop.
Save cirrusUK/8ff276a9242a24940ebdf2c56a972548 to your computer and use it in GitHub Desktop.
Heads Up Display showing realtime RAM & CPU usage in corner of VDU, using osd_cat.
#!/bin/bash
export DISPLAY=":0"
export XDG_RUNTIME_DIR=/run/user/$(id -u)
while true; do free | grep Mem | awk '{print $3/$2 * 100.0}'; sleep 1; done | osd_cat --align right --pos bottom -o 50 --lines 1 --delay 2 -f '-*-envy code r-*-*-*-*-24-*-*-*-*-*-*-*' -c orange & while true; do top -b -n1 | grep "Cpu(s)" | awk '{print $2 + $4}'; sleep 1; done | osd_cat --align right --pos bottom --lines 1 --delay 2 -f '-*-envy code r-*-*-*-*-24-*-*-*-*-*-*-*' -o 20 -c orange
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment