From: Luke Bonham Date: Mon, 28 Aug 2017 12:04:23 +0000 (+0200) Subject: Merge pull request #359 from rohieb/mpd-port-from-environment-for-master X-Git-Url: https://git.madduck.net/etc/awesome.git/commitdiff_plain/9b99234aca9053d184d46a89834b590455f56f7e?hp=12f0258dc82b8a1affa3a32549d3aabc62f6cada Merge pull request #359 from rohieb/mpd-port-from-environment-for-master mpd: respect MPD_HOST and MPD_PORT environment variables --- diff --git a/widget/mpd.lua b/widget/mpd.lua index d0b37d7..389cac9 100644 --- a/widget/mpd.lua +++ b/widget/mpd.lua @@ -26,8 +26,8 @@ local function factory(args) local args = args or {} local timeout = args.timeout or 2 local password = (args.password and #args.password > 0 and string.format("password %s\\n", args.password)) or "" - local host = args.host or "127.0.0.1" - local port = args.port or "6600" + local host = args.host or os.getenv("MPD_HOST") or "127.0.0.1" + local port = args.port or os.getenv("MPD_PORT") or "6600" local music_dir = args.music_dir or os.getenv("HOME") .. "/Music" local cover_pattern = args.cover_pattern or "*\\.(jpg|jpeg|png|gif)$" local cover_size = args.cover_size or 100