mpd: Export socket path as environment variable

This eliminates the need to specify it manually every time.
This commit is contained in:
Simon Bruder 2021-02-27 18:33:32 +01:00
parent a745d7353e
commit f03c1daa31
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 7 additions and 5 deletions

View file

@ -69,4 +69,6 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
home.packages = with pkgs; [ home.packages = with pkgs; [
mpc_cli mpc_cli
]; ];
home.sessionVariables.MPD_HOST = config.services.mpd.network.listenAddress;
} }

View file

@ -149,9 +149,9 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
"XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%"; "XF86AudioRaiseVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
"XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%"; "XF86AudioLowerVolume" = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
"XF86AudioPrev" = "exec ${pkgs.mpc_cli}/bin/mpc --host=${config.services.mpd.network.listenAddress} next"; "XF86AudioPrev" = "exec ${pkgs.mpc_cli}/bin/mpc next";
"XF86AudioNext" = "exec ${pkgs.mpc_cli}/bin/mpc --host=${config.services.mpd.network.listenAddress} prev"; "XF86AudioNext" = "exec ${pkgs.mpc_cli}/bin/mpc prev";
"XF86AudioPlay" = "exec ${pkgs.mpc_cli}/bin/mpc --host=${config.services.mpd.network.listenAddress} toggle"; "XF86AudioPlay" = "exec ${pkgs.mpc_cli}/bin/mpc toggle";
# Mumble PTT # Mumble PTT
"--no-repeat Shift_R" = "exec ${pkgs.dbus}/bin/dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.startTalking"; "--no-repeat Shift_R" = "exec ${pkgs.dbus}/bin/dbus-send --session --type=method_call --dest=net.sourceforge.mumble.mumble / net.sourceforge.mumble.Mumble.startTalking";
@ -338,8 +338,8 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
interval = 2; interval = 2;
tooltip-format = "MPD (connected)"; tooltip-format = "MPD (connected)";
tooltip-format-disconnected = "MPD (disconnected)"; tooltip-format-disconnected = "MPD (disconnected)";
on-scroll-up = "${pkgs.mpc_cli}/bin/mpc -h ${config.services.mpd.dataDir}/socket volume +2"; on-scroll-up = "${pkgs.mpc_cli}/bin/mpc volume +2";
on-scroll-down = "${pkgs.mpc_cli}/bin/mpc -h ${config.services.mpd.dataDir}/socket volume -2"; on-scroll-down = "${pkgs.mpc_cli}/bin/mpc volume -2";
consume-icons = { consume-icons = {
on = " "; on = " ";
}; };