Coder Social home page Coder Social logo

Comments (2)

lcpz avatar lcpz commented on June 24, 2024

You're not supposed to modify mpd.lua, but rather write a Lain MPD widget in theme.lua. Example:

theme.mpd = lain.widget.mpd {
    host = "example.com",
    port = "6600",
    music_dir = "path/to/your/music/directory",
    settings = function()
        widget:set_markup(mpd_now.artist .. " " .. mpd_now.title)
    end
}

Reference: Lain MPD widget documentation.

from awesome-copycats.

zenodotus280 avatar zenodotus280 commented on June 24, 2024

Thank you! I thought I had tried that already but I didn't put the host, port, and music directory high enough in the widget. The music dir wasn't needed in the end as MPD must handle that remotely and the default is also port 6600 so I could have omitted that too.

For anyone else wanting confirmation on what's needed (the first part is so I can 'super+left-click' to open a TUI music controller):

-- MPD
local mpc_remote = " -h moode.home.arpa -p 6600"
local musicplr = awful.util.terminal .. " -e ncmpcpp" .. mpc_remote
local mpdicon = wibox.widget.imagebox(theme.widget_music)

[...]

theme.mpd = lain.widget.mpd({
    host = "moode.home.arpa",
    port = "6600",
    settings = function()
    
[...]

from awesome-copycats.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.