Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mpd widget doesn't handle apostrophes #258

Closed
whooper2 opened this issue Jan 8, 2017 · 1 comment
Closed

Mpd widget doesn't handle apostrophes #258

whooper2 opened this issue Jan 8, 2017 · 1 comment

Comments

@whooper2
Copy link

whooper2 commented Jan 8, 2017

I'm using the mpd widget with awesome 4
When a song title has an apostrophe it displays it as " & apos ; "
here's the code i'm using:

mpdwidget = lain.widgets.mpd({
    settings = function()
        artist = mpd_now.artist .. " "
        title  = mpd_now.title  .. " "

        if mpd_now.state == "pause" then
            artist = " "
            title  = "paused  "
        elseif mpd_now.state == "stop" then
            artist = ""
            title  = ""
        end

        widget:set_text(artist .. "- " .. title)
    end
})
@lcpz
Copy link
Owner

lcpz commented Jan 9, 2017

It's because set_text ignores the Pango markup. Use set_markup.

mpdwidget = lain.widgets.mpd({
    settings = function()
        artist = mpd_now.artist .. " "
        title  = mpd_now.title  .. " "

        if mpd_now.state == "pause" then
            artist = " "
            title  = "paused  "
        elseif mpd_now.state == "stop" then
            artist = ""
            title  = ""
        end

        widget:set_markup(artist .. "- " .. title)
    end
})

@lcpz lcpz closed this as completed Jan 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants