First. We need to uncomment lines in mcabber configuration file.
vim ~/.mcabber/mcabberrc
Following lines are necessary to use:
set logging = 1Attention: Check folder grants. Directory ~/.mcabber/histo should exist!
set logging_dir = ~/.mcabber/histo
set statefile = ~/.mcabber/mcabber.state
Next we need small "parser" script. And here it is:
#!/bin/zshSorry for zsh :-[ Save them in home dir, and make it executable (+x).
MCABBER_NO=`cat /home/bosheee/.mcabber/mcabber.state &>/dev/null|wc -l`
[[ "$MCABBER_NO" -gt "0" ]] && echo "$MCABBER_NO Mess"
exit 0
Add this function somewhere below wibox.
function mcabber_mess()Also add hook after hourse hook:
local filedescriptor = io.popen('~/mcabber_message_num.sh')
local value = nil
if filedescriptor ~= nil then
value = filedescriptor:read()
end
filedescriptor:close()
if value == nil then
return '0 Mess'
else
return value
end
end
getmcabbermessnum = widget({
type = 'textbox',
name = 'getmcabbermessnum',
align = 'right'})
wicked.register(
getmcabbermessnum,
mcabber_mess,
" $1 ")
awful.hooks.timer.register(3, function() getmcabbermessnum.text = mcabber_mess() end)Add getmcabbermessnum in your mywibox[s].widget array.
All done! Restart awesome and enjoy it. I will answer any questions in comments.
P.S thanks a lot people in IRC chanel, and my friend for help =)