Andreas Baulig f0c4ba0339
Set system locale to international
Running `free` without any modifications will result in the output being
localized into the current system-language (i.e. German if you're running a
German install of Linux). The parsing of the `memory` script however relies
on the output being in english (US).

As an easy fix we just set the system locale tempoararily to 'C' (which is the
_default_ language, i.e. english in case of `free`).
2019-05-20 16:15:05 +02:00

13 lines
373 B
Bash
Executable File

#!/bin/sh
case $BLOCK_BUTTON in
1) notify-send "🧠 Memory hogs" "$(ps axch -o cmd:15,%mem --sort=-%mem | head)" ;;
3) notify-send "🧠 Memory module" "\- Shows Memory Used/Total.
- Click to show memory hogs." ;;
esac
# Set language to international or otherwise 'free' will output in the current
# system language
LC_ALL=C free -h | awk '/^Mem:/ {print $3 "/" $2}'