mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-23 20:12:31 +00:00
Fix CPU speed on BSD
This commit is contained in:
8
neofetch
8
neofetch
@@ -1104,10 +1104,18 @@ getcpu () {
|
|||||||
# Get cpu cores
|
# Get cpu cores
|
||||||
cores=$(sysctl -n hw.ncpu)
|
cores=$(sysctl -n hw.ncpu)
|
||||||
|
|
||||||
|
# Fix for speeds under 1ghz
|
||||||
|
if [ -z "${speed:1}" ]; then
|
||||||
|
speed="0.${speed}"
|
||||||
|
else
|
||||||
|
speed=${speed:0:1}.${speed:1}
|
||||||
|
fi
|
||||||
|
|
||||||
cpu="$cpu @ ${speed}GHz"
|
cpu="$cpu @ ${speed}GHz"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
# 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)}
|
||||||
|
|||||||
Reference in New Issue
Block a user