You are not logged in.
Pages: 1
ive got a naughty calendar popup running. works great. problem that i have is that the week starts on a Monday instead of Sunday. does anyone know how to change this?
here is the relevant sections of my rc.lua file:
local calendar = nil
local offset = 0
function remove_calendar()
if calendar ~= nil then
naughty.destroy(calendar)
calendar = nil
offset = 0
end
end
function add_calendar(inc_offset)
local save_offset = offset
remove_calendar()
offset = save_offset + inc_offset
local datespec = os.date("*t")
datespec = datespec.year * 12 + datespec.month - 1 + offset
datespec = (datespec % 12 + 1) .. " " .. math.floor(datespec / 12)
local cal = awful.util.pread("cal -m " .. datespec)
cal = string.gsub(cal, "^%s*(.-)%s*$", "%1")
calendar = naughty.notify({
text = string.format('<span font_desc="%s">%s</span>', "monospace", os.date("%a, %d %B %Y") .. "\n" .. cal),
position = "bottom_right",
timeout = 0, hover_timeout = 0.5,
width = 160,
})
end
mytextbox.mouse_enter = function()
add_calendar(0)
end
mytextbox.mouse_leave = remove_calendar
mytextbox:buttons({
button({ }, 1, function()
add_calendar(-1)
end),
button({ }, 3, function()
add_calendar(1)
end),
button({ 'Shift' }, 1, function()
add_calendar(-12)
end),
button({ 'Shift' }, 3, function()
add_calendar(12)
end),
})
thanks.
Why is there no awesome forums?
Offline
Why is there no awesome forums?
There's an IRC channel, a mailing list and a wiki.
Offline
thelastknowngod wrote:Why is there no awesome forums?
There's an IRC channel, a mailing list and a wiki.
and it is a pain in the ass finding information. its a lot easier to search a forum than a mailing list.
Offline
problem that i have is that the week starts on a Monday instead of Sunday.
man cal
Did I really needed to write this, isn't it obvious? How do you find your way in awesome, or Linux at all I wonder.
You need to install an RTFM interface.
Offline
local cal = awful.util.pread("cal " .. datespec)
Offline
Pages: 1