screenFetch
screenFetch copied to clipboard
Fix the memory calculation BUG of 1840 lines
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 ))