Are you using conkyconf? (Easy configuring conky with conkyconf)
One could do this with lua . I just tested it and it would work … but you’ll have to run some sudo command before running conky so that sudo would remember your password or you would have to be member of the wheel group without password.
Right now conky_parselog re-parse the ${tail} conky variable, which just follows the file system access rights. One could replace this command with ‘sudo tail’. See the code below:
-- parse log files
function conky_parselog (...)
local logfile,n,color,noparse
if (arg[1]) then logfile = arg[1] else return "" end
if (arg[2]) then n = tonumber(arg[2]) else n = 3 end
if (arg[3]) then color = arg[3] else color = 'ff0000' end
if (arg[4]) then noparse = arg[4] else noparse = 1 end
if n > 30 then n = 30 end
-- local log = str2table(conky_parse('${tail ' .. logfile .. ' ' .. n .. '}'))
local l = assert(io.popen("sudo tail -" .. n .. " " .. logfile))
log = {}
for s in l:lines() do table.insert(log, s) end
l:close()
local i = table.getn(log)
local s = 0
if i > n then
s = i - n
end
local lines, line = ""
while i > s do
line=log*
line = line:gsub("%$", "%%$$")
line = line:gsub("%+", "%%+")
line = line:gsub("%*", "%%*")
if noparse == 1 then
line=line:gsub('%w* *%w* *(%d:]*) *%w* *(%w.-_*)(:*) * %d.]*]', "${color aaaaaa}%1 ${color white}%2%3", 1)
line=line:gsub(logfile:gsub('/.*/(%w*).*',"%1: ",1),"",1)
line=line:gsub(': ',": ${color " .. color .."}",1)
line=line:gsub('#',"\\#")
line=line:gsub('%w* *%w* *(%d:]*) *%w* *(%w.-_*): *', "${color aaaaaa}%1 ${color white}%2: ${color " .. color .."}",1)
else
line=string.format("${color %s}", color) .. line
end
line = line:gsub("%%(+$*])", "%1")
lines=lines .. line .. '
'
i = i -1
end
return lines
end
The code in red is commented out ; the code in green is added.
Further I would have to modify conkyconf so that option -l only works for members of the wheel group and print this for others:
"You don't have read access to $log. Skipping logfile monitoring. "
This is actually what it does at the moment for normal users.
Non being allowed to read /var/log/messages as normal user is not a bug. Under ArchLinux however, you could add yourself to the “log” group and get read access to the logs.*