2023-05-24 13:37:59 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, spotify, xorg, makeWrapper }:
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "spotifywm-unstable";
|
2022-11-21 17:40:18 +00:00
|
|
|
version = "2022-10-26";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-11-21 17:40:18 +00:00
|
|
|
owner = "dasJ";
|
|
|
|
repo = "spotifywm";
|
|
|
|
rev = "8624f539549973c124ed18753881045968881745";
|
|
|
|
sha256 = "sha256-AsXqcoqUXUFxTG+G+31lm45gjP6qGohEnUSUtKypew0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
buildInputs = [ xorg.libX11 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
2023-05-24 13:37:59 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/{bin,lib}
|
|
|
|
install -Dm644 spotifywm.so $out/lib/
|
|
|
|
ln -sf ${spotify}/bin/spotify $out/bin/spotify
|
|
|
|
|
|
|
|
# wrap spotify to use spotifywm.so
|
|
|
|
wrapProgram $out/bin/spotify --set LD_PRELOAD "$out/lib/spotifywm.so"
|
|
|
|
# backwards compatibility for people who are using the "spotifywm" binary
|
|
|
|
ln -sf $out/bin/spotify $out/bin/spotifywm
|
|
|
|
|
|
|
|
runHook postInstall
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/dasJ/spotifywm";
|
|
|
|
description = "Wrapper around Spotify that correctly sets class name before opening the window";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
2023-05-24 13:37:59 +00:00
|
|
|
maintainers = with maintainers; [ jqueiroz the-argus ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|