You are not logged in.

#1 2009-02-26 02:07:38

thelastknowngod
Member
Registered: 2008-01-11
Posts: 110

AwesomeWM calendar

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

#2 2009-02-26 10:17:53

Gigamo
Member
Registered: 2008-01-19
Posts: 394

Re: AwesomeWM calendar

thelastknowngod wrote:

Why is there no awesome forums?

There's an IRC channel, a mailing list and a wiki.

Offline

#3 2009-02-26 13:45:20

thelastknowngod
Member
Registered: 2008-01-11
Posts: 110

Re: AwesomeWM calendar

Gigamo wrote:
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

#4 2009-02-26 19:28:02

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: AwesomeWM calendar

thelastknowngod wrote:

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

#5 2009-02-28 07:37:18

rasmusx
Member
Registered: 2008-12-10
Posts: 3

Re: AwesomeWM calendar

local cal = awful.util.pread("cal " .. datespec)

Offline

Board footer

Powered by FluxBB