Merge pull request #88 from mvonmaltitz/patch-1

Make ram-widget compatible for non-english OS
This commit is contained in:
streetturtle 2019-09-01 21:58:14 -04:00 committed by GitHub
commit 7bd563e164
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -42,7 +42,7 @@ local function getPercentage(value)
return math.floor(value / (total+total_swap) * 100 + 0.5) .. '%'
end
watch('bash -c "free | grep -z Mem.*Swap.*"', 1,
watch('bash -c "LANGUAGE=en_US.UTF-8 free | grep -z Mem.*Swap.*"', 1,
function(widget, stdout, stderr, exitreason, exitcode)
total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap =
stdout:match('(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*Swap:%s*(%d+)%s*(%d+)%s*(%d+)')