Skip to content

Commit 8858050

Browse files
authored
Merge pull request #46 from vinipsmaker/patch-1
Fix ram_percentage.sh script when running on non-US locales
2 parents 2d43413 + cec25d9 commit 8858050

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/ram_percentage.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22

33
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4+
export LANG=C
45

56
source "$CURRENT_DIR/helpers.sh"
67

@@ -15,7 +16,7 @@ print_ram_percentage() {
1516
ram_percentage_format=$(get_tmux_option "@ram_percentage_format" "$ram_percentage_format")
1617

1718
if command_exists "free"; then
18-
free | awk -v format="$ram_percentage_format" '$1 == "Mem:" {printf(format, 100*$3/$2)}'
19+
free | awk -v format="$ram_percentage_format" '$1 ~ /Mem/ {printf(format, 100*$3/$2)}'
1920
elif command_exists "vm_stat"; then
2021
# page size of 4096 bytes
2122
stats="$(vm_stat)"

0 commit comments

Comments
 (0)