2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-05-18 17:18:34 +00:00
|
|
|
|
2020-05-14 17:36:23 +00:00
|
|
|
, fetchurl
|
|
|
|
, coreutils
|
|
|
|
, makeWrapper
|
|
|
|
, sway-unwrapped
|
|
|
|
, installShellFiles
|
|
|
|
, wl-clipboard
|
|
|
|
, libnotify
|
|
|
|
, slurp
|
|
|
|
, grim
|
|
|
|
, jq
|
2020-05-18 17:18:34 +00:00
|
|
|
|
|
|
|
, python3Packages
|
2020-05-14 17:36:23 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
grimshot = stdenv.mkDerivation rec {
|
|
|
|
pname = "grimshot";
|
2020-06-25 12:59:25 +00:00
|
|
|
version = sway-unwrapped.version;
|
2020-05-14 17:36:23 +00:00
|
|
|
|
2020-06-25 12:59:25 +00:00
|
|
|
src = sway-unwrapped.src;
|
2020-05-14 17:36:23 +00:00
|
|
|
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-06-25 12:59:25 +00:00
|
|
|
installManPage contrib/grimshot.1
|
2020-05-14 17:36:23 +00:00
|
|
|
|
2020-06-25 12:59:25 +00:00
|
|
|
install -Dm 0755 contrib/grimshot $out/bin/grimshot
|
2020-05-14 17:36:23 +00:00
|
|
|
wrapProgram $out/bin/grimshot --set PATH \
|
2021-01-15 13:21:58 +00:00
|
|
|
"${lib.makeBinPath [
|
2020-05-14 17:36:23 +00:00
|
|
|
sway-unwrapped
|
|
|
|
wl-clipboard
|
|
|
|
coreutils
|
|
|
|
libnotify
|
|
|
|
slurp
|
|
|
|
grim
|
|
|
|
jq
|
|
|
|
] }"
|
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
installCheckPhase = ''
|
|
|
|
# check always returns 0
|
|
|
|
if [[ $($out/bin/grimshot check | grep "NOT FOUND") ]]; then false
|
|
|
|
else
|
|
|
|
echo "grimshot check passed"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-05-14 17:36:23 +00:00
|
|
|
description = "A helper for screenshots within sway";
|
|
|
|
homepage = "https://github.com/swaywm/sway/tree/master/contrib";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [
|
|
|
|
sway-unwrapped.meta.maintainers
|
|
|
|
evils
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-05-18 17:18:34 +00:00
|
|
|
|
|
|
|
inactive-windows-transparency = python3Packages.buildPythonApplication rec {
|
|
|
|
# long name is long
|
|
|
|
lname = "inactive-windows-transparency";
|
|
|
|
pname = "sway-${lname}";
|
|
|
|
version = sway-unwrapped.version;
|
|
|
|
|
|
|
|
src = sway-unwrapped.src;
|
|
|
|
|
|
|
|
format = "other";
|
|
|
|
dontBuild = true;
|
|
|
|
dontConfigure = true;
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ python3Packages.i3ipc ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -Dm 0755 $src/contrib/${lname}.py $out/bin/${lname}.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = sway-unwrapped.meta // {
|
|
|
|
description = "It makes inactive sway windows transparent";
|
|
|
|
homepage = "https://github.com/swaywm/sway/tree/${sway-unwrapped.version}/contrib";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-05-14 17:36:23 +00:00
|
|
|
}
|