2024-05-15 15:35:15 +00:00
|
|
|
{ coreutils
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitHub
|
2024-05-15 15:35:15 +00:00
|
|
|
, fontconfig
|
2021-12-06 16:07:01 +00:00
|
|
|
, gawk
|
|
|
|
, getopt
|
2024-05-15 15:35:15 +00:00
|
|
|
, i3lock-color
|
|
|
|
, imagemagick
|
|
|
|
, installShellFiles
|
|
|
|
, lib
|
|
|
|
, makeWrapper
|
|
|
|
, scrot
|
|
|
|
, stdenv
|
|
|
|
|
|
|
|
, screenshotCommand ? ""
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
stdenv.mkDerivation {
|
2021-12-06 16:07:01 +00:00
|
|
|
pname = "i3lock-fancy";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "unstable-2023-04-28";
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "meskarune";
|
|
|
|
repo = "i3lock-fancy";
|
2024-05-15 15:35:15 +00:00
|
|
|
rev = "55f5c30071403faf5ae4363a54b6d1f63876d5ce";
|
|
|
|
hash = "sha256-ISymKlxLE4/ChDiyjnavFx4T5hEVI62cCxYLWrWiHrg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
installShellFiles
|
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i i3lock-fancy \
|
|
|
|
-e 's|icon="/usr/share/i3lock-fancy/icons/lockdark.png"|icon="'$out'/share/i3lock-fancy/icons/lockdark.png"|' \
|
2024-05-15 15:35:15 +00:00
|
|
|
-e 's|icon="/usr/share/i3lock-fancy/icons/lock.png"|icon="'$out'/share/i3lock-fancy/icons/lock.png"|'
|
2020-04-24 23:36:52 +00:00
|
|
|
rm Makefile
|
2024-05-15 15:35:15 +00:00
|
|
|
'' + lib.optionalString (screenshotCommand != "") ''
|
|
|
|
sed -i i3lock-fancy \
|
|
|
|
-e "s|shot=(import -silent -window root)|shot=(${screenshotCommand})|";
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
installPhase = ''
|
2024-05-15 15:35:15 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/bin $out/share/i3lock-fancy/icons
|
|
|
|
cp i3lock-fancy $out/bin/i3lock-fancy
|
2022-12-28 21:21:41 +00:00
|
|
|
ln -s $out/bin/i3lock-fancy $out/bin/i3lock
|
2020-04-24 23:36:52 +00:00
|
|
|
cp icons/lock*.png $out/share/i3lock-fancy/icons
|
2024-05-15 15:35:15 +00:00
|
|
|
installManPage doc/i3lock-fancy.1
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/i3lock-fancy \
|
|
|
|
--prefix PATH : ${lib.makeBinPath [ coreutils fontconfig gawk getopt i3lock-color imagemagick scrot ]}
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "i3lock is a bash script that takes a screenshot of the desktop, blurs the background and adds a lock icon and text";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/meskarune/i3lock-fancy";
|
2024-05-15 15:35:15 +00:00
|
|
|
maintainers = [ maintainers.reedrw ];
|
|
|
|
mainProgram = "i3lock-fancy";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|