lcpz / lain

Awesome WM complements

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

notification_preset.font for widget/cal gets ignored in favor of theme.font

hp-pepster opened this issue · comments

awesome:

awesome v4.3-1063-gf473639c5 (Too long)
• Compiled against Lua 5.3.6 (running with Lua 5.3)
• API level: 4
• D-Bus support: yes
• xcb-errors support: yes
• execinfo support: yes
• xcb-randr version: 1.6
• LGI version: 0.9.2
• Transparency enabled: yes
• Custom search paths: no

Lua

Lua 5.4.3  Copyright (C) 1994-2021 Lua.org, PUC-Rio

OS: Manjaro


Setting notification_preset.font in rc.lua or directly in widget.cal has no effect, instead theme.font is used.

My rc.lua:

local mycal = lain.widget.cal({
    attach_to = {mytextclock, mysimpletextclock},
    notification_preset = {
        font = "Liberation Mono 11",
    },
    followtag = false,
    week_number = "left",
    three = false
})

Setting notification_preset directly in widget/cal.lua:

local cal = {
    attach_to           = args.attach_to or {},
    week_start          = args.week_start or 2,
    three               = args.three or false,
    followtag           = args.followtag or false,
    week_number         = args.week_number or "none",
    week_number_format  = args.week_number_format or args.week_number == "left" and "%3d | " or "| %-3d",
    icons               = args.icons or helpers.icons_dir .. "cal/white/",
    notification_preset = { font = "Monospace 10", fg = "#FFFFFF", bg = "#000000" }
}

does ignore the font.

But changing widget/cal.lua further down:

cal.notification = naughty.notify {
    preset  = cal.notification_preset,
    font    = cal.notification_preset.font,
    screen  = cal.followtag and awful.screen.focused() or scr or 1,
    icon    = cal.icon,
    timeout = type(seconds) == "number" and seconds or cal.notification_preset.timeout or 5,
    text    = text
}

respects the set font.

Maybe I got something else wrong. I tried to find related changes in awesome but could not find anything.

Xorg.log or awesome-log does not seem to contain something relevant.

It seems you are not using the latest lain version, which, as you can see here, does consider your input notification_preset.

Sorry, I forgot to mention that I'm using the latest git-version of lain. I modified the line you mentioned to ignore the value passed from rc.lua just for tests.