KittyKatt / screenFetch

Fetches system/theme information in terminal for Linux desktop screenshots.
GNU General Public License v3.0
3.83k stars 453 forks source link

Fix the memory calculation BUG of 1840 lines #721

Closed YingchangLiu closed 1 year ago

YingchangLiu commented 3 years ago

I find the calculation result of ‘men’ here is wrong in the Chinese version, because it cannot correctly identify the position of free-b, so I modified it. I tested it on openSUSE Tumbleweed in Chinese and English, and now ‘men’ can be calculated correctly. ERROR:/usr/bin/screenfetch: Line 1802: 1921671168-: Syntax error: operand required (error symbol is "-") Initial:

mem=$(free -b | awk -F ':' 'NR==2{print $2}' | awk '{print $1"-"$6}')

    #usedmem=$((mem / 1024 / 1024))
    #totalmem=$((${mem//-*} / 1024 / 1024))

Edited: mem=$(free | awk 'NR==2{print $2"-"$7}') usedmem=$((mem / 1024 )) totalmem=$((${mem//-*} / 1024 ))

ChenSino commented 1 year ago

哈哈难受啊老哥,不合并每次都要手动编辑一下

YingchangLiu commented 1 year ago

哈哈难受啊老哥,不合并每次都要手动编辑一下

neofetch

YingchangLiu commented 1 year ago

哈哈难受啊老哥,不合并每次都要手动编辑一下 I have given up Screenfetch, Neofetch fixed the BUG. Developers haven't fixed Chinese for a year, so there's no need to use it. 我已近放弃screenfetch了,neofetch修复了这个BUG. 一年了也不修,没必要用了。