mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-22 11:39:53 +00:00
CPU: Simplify format check
This commit is contained in:
11
neofetch
11
neofetch
@@ -862,11 +862,8 @@ get_cpu() {
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# Format the output
|
|
||||||
case "$os" in
|
|
||||||
"Mac OS X" | "iPhone OS") ;;
|
|
||||||
*)
|
|
||||||
# Fix for speeds under 1ghz
|
# Fix for speeds under 1ghz
|
||||||
|
if [[ "$speed" ]]; then
|
||||||
if [[ -z "${speed:1}" ]]; then
|
if [[ -z "${speed:1}" ]]; then
|
||||||
speed="0.${speed}"
|
speed="0.${speed}"
|
||||||
else
|
else
|
||||||
@@ -874,14 +871,10 @@ get_cpu() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
cpu="$cpu @ ${speed}GHz $temp"
|
cpu="$cpu @ ${speed}GHz $temp"
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
# Remove uneeded patterns from cpu output
|
# Remove uneeded patterns from cpu output
|
||||||
# This is faster than sed/gsub
|
|
||||||
cpu="${cpu//(tm)}"
|
|
||||||
cpu="${cpu//(TM)}"
|
cpu="${cpu//(TM)}"
|
||||||
cpu="${cpu//(r)}"
|
|
||||||
cpu="${cpu//(R)}"
|
cpu="${cpu//(R)}"
|
||||||
cpu="${cpu//CPU}"
|
cpu="${cpu//CPU}"
|
||||||
cpu="${cpu//Processor}"
|
cpu="${cpu//Processor}"
|
||||||
|
|||||||
Reference in New Issue
Block a user