Open typr7 opened 3 years ago
和你一样的问题,根据你的提示,把screenfetch的LANGUAGE指定一下就好了,不影响你外面的全局locale
It looks like this happens whenever you have a language where the word for memory is over a certain length. The result it that free -b
returns something like this:
$ LANG=de_DE.UTF-8 free -b
gesamt benutzt frei gemns. Puffer/Cache verfügbar
Speicher:67344703488 14921134080 46072750080 4848996352 6350819328 46876737536
Swap: 17179865088 0 17179865088
Since the word for mem pushes into the first number, the awk on line 1801 doesn't work.
Thanks for your help, edit shell script screenfetch line 1801:
mem=$(free -b | awk 'NR==2{print $2"-"$7}')
to
mem=$(LANG=en_US.UTF-8 free -b | awk 'NR==2{print $2"-"$7}')
can solve this problem
谢谢你们的帮助, 把screenfetch shell脚本的1801行由:
mem=$(free -b | awk 'NR==2{print $2"-"$7}')
改为
mem=$(LANG=en_US.UTF-8 free -b | awk 'NR==2{print $2"-"$7}')
能解决这个问题
I have the same issue with de_DE.UTF-8
.
I submitted a PR to resolve the issue a couple of weeks ago.
https://github.com/KittyKatt/screenFetch/pull/708
That being said, there are lot of different ways to fix it.
Can any of you try out master now that I merged #708 ?
it seems doesn't work
git clone https://github.com/KittyKatt/screenFetch.git
cd screenFetch
./screenfetch-dev
and this is the output
That's mighty unfortunate. I'll need to take a longer look at it.
mem=$(LANG=en_US.UTF-8 free -b | awk 'NR==2{print $2"-"$6}')
works for me
or replace the full width colon :
in my case
mem=$(free -b | awk 'sub(/:/,":")' | awk -F ':' 'NR==1{print $2}' | awk '{print $1"-"$6}')
mem=$(LANG=en_US.UTF-8 free -b | awk 'NR==2{print $2"-"$6}')
works for me
Does this require the en_US.UTF-8
locale to be enabled on your system? Maybe LANG=C
instead?
LANG=C
would be better if someone could test that. We can't guarantee everyone has en_US enabled.
LANG=C
works for me
I'll try to get a fix tested tomorrow at work and committed to close this and the other issues about this.
LC_ALL=C screenfetch does the trick. At least for me
it displays wrong ram but if I switch my language to English It works well Is there any way to fix this error?