From bd3c5aa63949f2e394a4477dfea611dfd22121ae Mon Sep 17 00:00:00 2001 From: Sravanth C <54331348+chebro@users.noreply.github.com> Date: Wed, 28 Apr 2021 07:01:45 +0530 Subject: [PATCH 1/4] Feature: add password support to MPDClient --- bin/miniplayer | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/miniplayer b/bin/miniplayer index ce9d93b..0ee3c12 100755 --- a/bin/miniplayer +++ b/bin/miniplayer @@ -23,7 +23,8 @@ if "player" not in config.sections(): if "mpd" not in config.sections(): config["mpd"] = {"host": "localhost", - "port": "6600" + "port": "6600", + "pass": False } player_config = config["player"] @@ -45,6 +46,7 @@ MUSICDIR = os.path.expanduser(MUSICDIR) # MPD config MPDHOST = mpd_config.get("host", "localhost") MPDPORT = mpd_config.getint("port", 6600) +MPDPASS = mpd_config.get("pass", False) # What to use to draw images IMAGEMETHOD = player_config.get("image_method", "pixcat") @@ -86,6 +88,8 @@ class Player: # MPD init self.client = MPDClient() self.client.connect(MPDHOST, MPDPORT) + if MPDPASS: + self.client.password(MPDPASS) self.last_song = None From b1588ac70f63fd1ae66cd8aafbbd66dbb6cf9046 Mon Sep 17 00:00:00 2001 From: Sravanth C <54331348+chebro@users.noreply.github.com> Date: Wed, 28 Apr 2021 07:02:25 +0530 Subject: [PATCH 2/4] Update config.example to include a password field --- config.example | 1 + 1 file changed, 1 insertion(+) diff --git a/config.example b/config.example index 952902c..591bec6 100644 --- a/config.example +++ b/config.example @@ -7,3 +7,4 @@ image_method = pixcat [mpd] host = localhost port = 6600 +pass = example From 6af0b5c0e5a0162cc947d1fc94fd45a0cc2bae64 Mon Sep 17 00:00:00 2001 From: Sravanth C <54331348+chebro@users.noreply.github.com> Date: Wed, 28 Apr 2021 07:21:20 +0530 Subject: [PATCH 3/4] Update README.md to reflect the last change --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index c257e4d..80fcf6a 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ The config file is located at `~/.config/miniplayer/config`. The example configu #### mpd * ***host*:** The mpd host * ***port*:** The mpd port +* ***pass*:** The mpd password ## Keybinds From 278a3bfdb444ff4235f5dc9b19f998a4b5165221 Mon Sep 17 00:00:00 2001 From: Cheb <54331348+chebro@users.noreply.github.com> Date: Wed, 28 Apr 2021 15:17:54 +0530 Subject: [PATCH 4/4] fix: comment pass field in config.example --- config.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.example b/config.example index 591bec6..925dcc0 100644 --- a/config.example +++ b/config.example @@ -7,4 +7,4 @@ image_method = pixcat [mpd] host = localhost port = 6600 -pass = example +# pass = example