You are not logged in.

#1 2009-03-05 02:57:56

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Change color of awesome3 textbox widget

I'm using a mail widget in awesome3 that I'd like to be a different color on the statusbar. I was using this wiki page except took out the color arguments in the python script as they made awesome error out:

http://awesome.naquadah.org/wiki/index. … ail_widget

Nothing in any wiki I could find had arguments you could apply to a textbox.

Offline

#2 2009-03-05 03:18:54

ent
Member
Registered: 2008-12-15
Posts: 53

Re: Change color of awesome3 textbox widget

I think you need to use span tags, this is what I have in my rc.lua for one of my textboxes:

rightspacer = widget({ type = 'textbox', align = 'right' })
rightspacer.text = " <span color='#446655'>|</span> "

hope it helps smile

Offline

#3 2009-03-05 03:53:13

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: Change color of awesome3 textbox widget

ent wrote:

I think you need to use span tags, this is what I have in my rc.lua for one of my textboxes:

rightspacer = widget({ type = 'textbox', align = 'right' })
rightspacer.text = " <span color='#446655'>|</span> "

hope it helps smile

It'll help for some other things, but the xxxx.text line isn't even needed for this widget, I just tried it without it. A config I saw did what I want with the clock widget by using a functions.lua file so the parts were like this:

rc.lua

--Clock
clockbox = widget({ type = 'textbox', align = 'right' })

-- 1 minute
awful.hooks.timer.register(60, function ()
    functions.clock('%B %d,', '%H:%M', clockbox)
end)

functions.lua

function clock(dateformat, timeformat, cwidget)
    cwidget.text = spacer..set_fg(beautiful.fg_focus, os.date(dateformat))..spacer..os.date(timeformat)..spacer
end

I just can't gather how to put that together for the mail.

Offline

#4 2009-03-05 04:22:16

ent
Member
Registered: 2008-12-15
Posts: 53

Re: Change color of awesome3 textbox widget

maybe you could put the output of the mail script into a variable and just do something like

mailwidget.text = "<span whatever> " .. mailoutput .. " </span>"

though I'm probably just repeating myself, sorry if I'm not helping too well hmm
I think you're right though about there not being textbox arguments, all the configs I've ever looked through use span tags. I think that'd be a good thing to include in the next awesome release...

Actually, it looks like you might be able to just add the span tags onto the L variable in the function before it puts it into mail.text. Though I guess that doesn't help if you want to change the color when there's new mail.

Last edited by ent (2009-03-05 04:36:32)

Offline

#5 2009-03-05 21:43:59

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: Change color of awesome3 textbox widget

I don't know if that is possible. I think the hook is displaying the output with this line:

awful.hooks.timer.register(30, function ()
    local f = io.open("/home/YOUR_USER/tmp/gmail")
   local l = f:read() -- read output of command
    f:close()

    mymail.text = l
    os.execute("~/scripts/unread.py > ~/tmp/gmail &")
end)

Offline

#6 2009-03-06 04:27:25

Reasons
Member
From: Washington
Registered: 2007-11-04
Posts: 572

Re: Change color of awesome3 textbox widget

I got it, I feel really stupid right now as it was looking at me the whole time, the output was called under the hook part, which I think you pointed out. hmm

Offline

Board footer

Powered by FluxBB