improved cmd

This commit is contained in:
committer@tuxwarrior
2026-03-09 10:14:05 -05:00
parent fb12f65bca
commit 608ee31c92

View File

@@ -16,7 +16,13 @@ displayResources() {
elif [[ "${operation}" == "topmem" ]]; then elif [[ "${operation}" == "topmem" ]]; then
# the process that consumes the most memory # the process that consumes the most memory
echo /home/poq/.config/nwg-panel/icons/noun-ram-8252148.svg echo /home/poq/.config/nwg-panel/icons/noun-ram-8252148.svg
ps -eo pid,cmd,%mem --sort=-%mem | head -n 2 | awk 'NR==2 {printf "%s: %s (%s%)", $1, $2, $4}' ps -eo pid,%mem,cmd --sort=-%mem | head -n 2 | awk 'NR > 1 {
pid = $1;
mem_percent = $2;
cmd_path = $3;
gsub(/.*\//, "", cmd_path);
{printf "%s: %s (%s%)", pid, cmd_path, mem_percent}
}'
elif [[ "${operation}" == "topcpu" ]]; then elif [[ "${operation}" == "topcpu" ]]; then
# the process that consumes the most cpu # the process that consumes the most cpu
echo /home/poq/.config/nwg-panel/icons/noun-cpu-8293079.svg echo /home/poq/.config/nwg-panel/icons/noun-cpu-8293079.svg