We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c10d048 commit ab612fdCopy full SHA for ab612fd
lfetch
@@ -70,14 +70,16 @@ get_uptime()
70
71
get_cpu_idle()
72
{
73
+ local stats e idle
74
+
75
read -r stats < /proc/stat
76
77
e=$(echo $stats | cut -d " " -f2)
78
for i in {3..8}; do
79
e="$e + $(echo $stats | cut -d " " -f$i)"
80
done
81
- echo "$(((idle * 100) / ($e))) percent"
82
+ echo "$((($(echo $stats | cut -d " " -f5) * 100) / ($e))) percent"
83
}
84
85
get_interrupts()
@@ -111,7 +113,7 @@ get_bootloader()
111
113
112
114
info()
115
- printf "\e[1;%dm${1}\e[0;0m$("get_${2:-$1}")\n" $colour
116
+ printf "\e[1;%dm%s\e[0;0m%s\n" "$colour" "${1}" "$("get_${2:-$1}")"
117
118
119
loadcfg "/etc/lfetch.conf"
0 commit comments