diff options
author | Marcel von Maltitz <von.maltitz@gmx.de> | 2019-07-19 18:46:28 +0200 |
---|---|---|
committer | streetturtle <streetturtle@gmail.com> | 2019-09-02 15:48:25 -0400 |
commit | 2752c06548c419ba657adb67e7a94a1dc5d5d1fa (patch) | |
tree | 0419b22fefc75860ac70d68bb2df9f5eb45fa8e1 | |
parent | b41daeb9b2fd0206124740b165bcb8254a84c7b4 (diff) |
Make ram-widget compatible for non-english OS
The output of the free command is grep'ed while assuming english column names. This grep fails when given non-english localization.
Setting the LANGUAGE variable inside the bash invocation solves this problem.
-rw-r--r-- | ram-widget/ram-widget.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ram-widget/ram-widget.lua b/ram-widget/ram-widget.lua index a5414c8..d8cb11f 100644 --- a/ram-widget/ram-widget.lua +++ b/ram-widget/ram-widget.lua @@ -48,7 +48,7 @@ local function worker(args) 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+)') |