Fix trailing whitespace in cpu name

This commit is contained in:
Dylan 2016-01-24 23:36:54 +11:00
parent b80b09376a
commit 7e42f0c5c3
1 changed files with 10 additions and 8 deletions

16
fetch
View File

@ -559,6 +559,7 @@ getcpu () {
# Get cpu name # Get cpu name
cpu="$(grep -F 'model name' /proc/cpuinfo)" cpu="$(grep -F 'model name' /proc/cpuinfo)"
cpu=${cpu/model name*: /} cpu=${cpu/model name*: /}
cpu=${cpu%% *}
cpu=${cpu/@*/} cpu=${cpu/@*/}
# Get cpu speed # Get cpu speed
@ -658,13 +659,14 @@ getcpu () {
# Remove uneeded patterns from cpu output # Remove uneeded patterns from cpu output
# This is faster than sed/gsub # This is faster than sed/gsub
cpu=${cpu//(tm)/} cpu=${cpu//'(tm)'}
cpu=${cpu//(TM)/} cpu=${cpu//'(TM)'}
cpu=${cpu//(r)/} cpu=${cpu//'(r)'}
cpu=${cpu//(R)/} cpu=${cpu//'(R)'}
cpu=${cpu// CPU/} cpu=${cpu// 'CPU'}
cpu=${cpu// Processor/} cpu=${cpu// 'Processor'}
cpu=${cpu// Six-Core/} cpu=${cpu// 'Six-Core'}
cpu=${cpu// 'with Radeon HD Graphics'}
} }
getgpu () { getgpu () {