lua rewrite
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
local util = require("modules/util")
|
||||
|
||||
-- CPU modelname
|
||||
local function get_cpu_modelname()
|
||||
local name = util.grep("/proc/cpuinfo", "^model name%s*:%s*(.+)") or
|
||||
util.grep("/proc/cpuinfo", "^Hardware%s*:%s*(.+)")
|
||||
|
||||
-- Shorter modelname for Intel i3/i5/i7/i9 CPUs
|
||||
if name then
|
||||
name = name:match("([iI][3579]%-[%d]+[A-Za-z]*)") or name
|
||||
end
|
||||
|
||||
return name
|
||||
end
|
||||
|
||||
return { name = "cpu", cmd = get_cpu_modelname }
|
||||
Reference in New Issue
Block a user