ram 374 B

12345678910111213141516
  1. #!/usr/bin/env bash
  2. total_used_mebi=$(free --mebi | grep Mem: | awk '{printf ("%2.2fGiB/%2.2fGiB\n", ($2/1024), ($3/1024))}')
  3. pct=$(free --mebi | grep Mem: | awk '{printf ("%.0f%%\n", (($3/$2)*100))}')
  4. # full_text
  5. echo ${total_used_mebi}" (${pct})"
  6. # short_text
  7. echo ${pct}
  8. case $BLOCK_BUTTON in
  9. 1) ~/.myScripts/top5_mem_usage.sh;;
  10. 3) alacritty -e htop;;
  11. esac