mpd: Listen on socket

This commit is contained in:
Simon Bruder 2020-12-05 18:53:35 +01:00
parent bdc1c12f9c
commit ba611b333b
No known key found for this signature in database
GPG key ID: 6F03E0000CC5B62F
2 changed files with 7 additions and 2 deletions

View file

@ -4,6 +4,7 @@
services.mpd = {
enable = true;
musicDirectory = "~/Music";
network.listenAddress = "${config.services.mpd.dataDir}/socket";
extraConfig = ''
zeroconf_enabled "no"
@ -29,6 +30,9 @@
package = pkgs.ncmpcpp.override { visualizerSupport = true; taglibSupport = false; };
mpdMusicDir = null; # does not work (not of type `null or path')
settings = {
# Connection
mpd_host = "${config.services.mpd.dataDir}/socket";
# Visualizer
visualizer_fifo_path = "${config.services.mpd.dataDir}/fifo";
visualizer_in_stereo = "yes";

View file

@ -332,6 +332,7 @@ lib.mkIf config.sbruder.gui.enable {
on-scroll-down = "brightnessctl set 5%-";
};
mpd = {
server = "${config.services.mpd.dataDir}/socket";
format = "{stateIcon} {consumeIcon}{randomIcon}{repeatIcon}{singleIcon}{artist} {title} ({elapsedTime:%M:%S}/{totalTime:%M:%S}) ";
format-disconnected = "Disconnected ";
format-stopped = "{consumeIcon}{randomIcon}{repeatIcon}{singleIcon}Stopped ";
@ -339,8 +340,8 @@ lib.mkIf config.sbruder.gui.enable {
interval = 2;
tooltip-format = "MPD (connected)";
tooltip-format-disconnected = "MPD (disconnected)";
on-scroll-up = "${pkgs.mpc_cli}/bin/mpc volume +2";
on-scroll-down = "${pkgs.mpc_cli}/bin/mpc volume -2";
on-scroll-up = "${pkgs.mpc_cli}/bin/mpc -h ${config.services.mpd.dataDir}/socket volume +2";
on-scroll-down = "${pkgs.mpc_cli}/bin/mpc -h ${config.services.mpd.dataDir}/socket volume -2";
consume-icons = {
on = " ";
};