mpd/ncmpcpp: Add dynamic color palette support

This commit is contained in:
Simon Bruder 2021-07-25 13:44:50 +02:00
parent 32b18bd005
commit 42a83bea7f
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -29,7 +29,25 @@ lib.mkIf nixosConfig.sbruder.gui.enable {
programs.ncmpcpp = {
enable = true;
package = pkgs.ncmpcpp.override { visualizerSupport = true; taglibSupport = false; };
package = (pkgs.ncmpcpp.override {
visualizerSupport = true;
taglibSupport = false;
}).overrideAttrs (o: o // {
nativeBuildInputs = o.nativeBuildInputs ++ (with pkgs; [ makeWrapper ]);
# !!! HACK: ncurses uses terminfos rs1 for alacritty (\033c\033]104\007)
# to reset the terminal when the window is resized. For achieving the
# required effect (clearing the terminal), \033c would be enough.
# \033]104\007 additionally resets colours set by dynamic-colors. This
# makes text written in those colours almost unreadable. Since xterm only
# uses \033c to reset the terminal and does not make ncmpcpp misbehave in
# alacritty, this wrapper tricks ncurses into thinking it is running in
# xterm.
postInstall = ''
wrapProgram $out/bin/ncmpcpp \
--run '[ "$TERM" = "alacritty" ] && export TERM="xterm"'
'';
});
mpdMusicDir = null; # does not work (not of type `null or path')
settings = {
# Connection