You are not logged in.

#1 2015-02-20 10:30:14

geromy-kun
Member
From: portland, OR
Registered: 2015-02-20
Posts: 4

[SOLVED]awesome wm widget styling problem

i wish to have awesome's clock widget be all lowercase letters. the current output looks like this:

 Fri Feb 20 | 02:26AM 

but

mytextclock = awful.widget.textclock(' <span text-transform="lowercase" > %as %b %d | %I:%M%p </span> ')

doesn't work, as pango does not support text-transform.
these uppercase letters are really ruining my asthetic :'( i'd appreciate if someone more versed in pango than i could help a sista out (id rather not have to write my own clock widget when the default is perfectly functional)
also id like to know if i can make the hour number display a single digit(when appliccable) instead of appending a 0 to the beginning.  thanks for any help!

Last edited by geromy-kun (2015-02-22 02:57:25)

Offline

#2 2015-02-20 11:18:45

geromy-kun
Member
From: portland, OR
Registered: 2015-02-20
Posts: 4

Re: [SOLVED]awesome wm widget styling problem

mytextclock = awful.widget.textclock(" %a %b %e | %l:%M:%S %P ", 1)

should do the trick (except the month/weekday are still capitalized >:(), but it causes awesome to spit out a bunch of this error:

/usr/share/awesome/lib/awful/widget/textclock.lua:26 bad argument #1 to 'date' (invalid conversion specifier '%l:%M:%S %P ')

Last edited by geromy-kun (2015-02-20 11:20:21)

Offline

#3 2015-02-20 17:16:38

nullified
Member
From: Massachusetts, USA
Registered: 2013-12-09
Posts: 468

Re: [SOLVED]awesome wm widget styling problem

Have you tried using Lua's

string.lower()

Also, if you want to inline the style I think it would be

<span style="text-transform:lowercase">

That error you are receiving is throwing me...they all appear to be valid conversion specifiers. But, the %l is not listed in this Lua documentation. I don't know why it would be omitted.

Edit: Here is some information regarding %l in Lua from Stack Overflow.

Last edited by nullified (2015-02-20 17:20:16)


"We may say most aptly, that the Analytical Engine weaves algebraical patterns just as the Jacquard-loom weaves flowers and leaves." - Ada Lovelace

Offline

#4 2015-02-22 02:56:48

geromy-kun
Member
From: portland, OR
Registered: 2015-02-20
Posts: 4

Re: [SOLVED]awesome wm widget styling problem

thanks for the string.lower section, this is what i ended up using:

mytextclock = wibox.widget.textbox(string.lower(string.gsub(os.date(" %a %b %e | %I:")," 0", " ")..os.date("%M:%S %p")))
myclocktimer = timer({ timeout = 1 })
myclocktimer:connect_signal("timeout", function() mytextclock:set_text(string.lower(string.gsub(os.date(" %a %b %e | %I:")," 0", " ")..os.date("%M:%S %p"))) end)
myclocktimer:start()

a little messy, most likely but it works!

Offline

Board footer

Powered by FluxBB