2023-10-18 15:06:04 -04:00
|
|
|
# https://github.com/NixOS/nixpkgs/blob/77b27fdb6a9ba01f60b8f5c48038938cf14b7d2f/pkgs/applications/audio/spotifywm/default.nix
|
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libX11,
|
|
|
|
makeBinaryWrapper,
|
|
|
|
spotify,
|
|
|
|
symlinkJoin,
|
2023-11-22 15:33:16 -05:00
|
|
|
}: let
|
2023-10-18 15:06:04 -04:00
|
|
|
spotifywm = stdenv.mkDerivation {
|
2023-11-01 15:33:33 -04:00
|
|
|
pname = "spotifywm";
|
|
|
|
version = "unstable-2022-10-25";
|
2023-10-18 15:06:04 -04:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dasJ";
|
|
|
|
repo = "spotifywm";
|
|
|
|
rev = "8624f539549973c124ed18753881045968881745";
|
|
|
|
hash = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0=";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libX11
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
install -Dm644 spotifywm.so $out/lib/spotifywm.so
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
in
|
2023-11-22 15:33:16 -05:00
|
|
|
symlinkJoin {
|
|
|
|
inherit (spotifywm) name;
|
2023-10-18 15:06:04 -04:00
|
|
|
|
2023-11-22 15:33:16 -05:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeBinaryWrapper
|
|
|
|
];
|
2023-10-18 15:06:04 -04:00
|
|
|
|
2023-11-22 15:33:16 -05:00
|
|
|
paths = [
|
|
|
|
spotify
|
|
|
|
spotifywm
|
|
|
|
];
|
2023-10-18 15:06:04 -04:00
|
|
|
|
2023-11-22 15:33:16 -05:00
|
|
|
postBuild = ''
|
|
|
|
wrapProgram $out/bin/spotify \
|
|
|
|
--suffix LD_PRELOAD : "$out/lib/spotifywm.so"
|
2023-10-18 15:06:04 -04:00
|
|
|
|
2023-11-22 15:33:16 -05:00
|
|
|
ln -sf $out/bin/spotify $out/bin/spotifywm
|
|
|
|
'';
|
2023-10-18 15:06:04 -04:00
|
|
|
|
2023-11-22 15:33:16 -05:00
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/dasJ/spotifywm";
|
|
|
|
description = "Wrapper around Spotify that correctly sets class name before opening the window";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
maintainers = with lib.maintainers; [jqueiroz the-argus];
|
|
|
|
mainProgram = "spotify";
|
|
|
|
};
|
|
|
|
}
|