Read MPD config from standard envvars
This commit is contained in:
parent
e2ace274b0
commit
f99830847d
1 changed files with 3 additions and 8 deletions
11
mmmpd
11
mmmpd
|
@ -1,5 +1,6 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import datetime
|
import datetime
|
||||||
|
@ -11,18 +12,12 @@ NAME = "Mattermost MPD now playing status"
|
||||||
VERSION = "1.0.0"
|
VERSION = "1.0.0"
|
||||||
|
|
||||||
### Config ########
|
### Config ########
|
||||||
|
|
||||||
MPD_HOST = "/var/lib/mpd/socket"
|
|
||||||
MPD_PORT = None
|
|
||||||
# or to connect with TCP
|
|
||||||
#MPD_HOST = "localhost"
|
|
||||||
#MPD_PORT = "6600"
|
|
||||||
|
|
||||||
EMOJI_PAUSED = "pause_button"
|
EMOJI_PAUSED = "pause_button"
|
||||||
EMOJI_PLAYING = "musical_note"
|
EMOJI_PLAYING = "musical_note"
|
||||||
|
|
||||||
###################
|
###################
|
||||||
|
|
||||||
|
MPD_HOST = os.getenv("MPD_HOST", "localhost") # Host (for TCP) or socket path
|
||||||
|
MPD_PORT = os.getenv("MPD_PORT", "6600") # Ignored when not using TCP
|
||||||
|
|
||||||
LOGGER = logging.getLogger("mmmpd")
|
LOGGER = logging.getLogger("mmmpd")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue