From 40c3a8eeadcf096236d2f96727cde17ea35d8e22 Mon Sep 17 00:00:00 2001 From: Evils Date: Thu, 14 May 2020 19:36:23 +0200 Subject: [PATCH 1/2] sway-contrib.grimshot: init at 2020-05-08 --- .../window-managers/sway/contrib.nix | 79 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 2 files changed, 80 insertions(+) create mode 100644 pkgs/applications/window-managers/sway/contrib.nix diff --git a/pkgs/applications/window-managers/sway/contrib.nix b/pkgs/applications/window-managers/sway/contrib.nix new file mode 100644 index 000000000000..6ab8ea4ec8ec --- /dev/null +++ b/pkgs/applications/window-managers/sway/contrib.nix @@ -0,0 +1,79 @@ +{ stdenv +, fetchurl +, coreutils +, makeWrapper +, sway-unwrapped +, installShellFiles +, wl-clipboard +, libnotify +, slurp +, grim +, jq +}: + +{ + +grimshot = stdenv.mkDerivation rec { + pname = "grimshot"; + version = "2020-05-08"; + rev = "b1d08db5f5112ab562f89564825e3e791b0682c4"; + + # master has new fixes and features, and a man page + # after sway-1.5 these may be switched to sway-unwrapped.src + bsrc = fetchurl { + url = "https://raw.githubusercontent.com/swaywm/sway/${rev}/contrib/grimshot"; + sha256 = "1awzmzkib8a7q5s78xyh8za03lplqfpbasqp3lidqqmjqs882jq9"; + }; + + msrc = fetchurl { + url = "https://raw.githubusercontent.com/swaywm/sway/${rev}/contrib/grimshot.1"; + sha256 = "191xxjfhf61gkxl3b0f694h0nrwd7vfnyp5afk8snhhr6q7ia4jz"; + }; + + dontBuild = true; + dontUnpack = true; + dontConfigure = true; + + outputs = [ "out" "man" ]; + + nativeBuildInputs = [ makeWrapper installShellFiles ]; + + installPhase = '' + installManPage ${msrc} + + install -Dm 0755 ${bsrc} $out/bin/grimshot + wrapProgram $out/bin/grimshot --set PATH \ + "${stdenv.lib.makeBinPath [ + 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 + ''; + + meta = with stdenv.lib; { + 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 + ]; + }; +}; + +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index cc405432704d..f73e398aab0e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20187,6 +20187,7 @@ in swaybg = callPackage ../applications/window-managers/sway/bg.nix { }; swayidle = callPackage ../applications/window-managers/sway/idle.nix { }; swaylock = callPackage ../applications/window-managers/sway/lock.nix { }; + sway-contrib = recurseIntoAttrs (callPackages ../applications/window-managers/sway/contrib.nix { }); swaylock-fancy = callPackage ../applications/window-managers/sway/lock-fancy.nix { }; From 1db748ef6aa41ec9777a9bf97963d3a4f38866c0 Mon Sep 17 00:00:00 2001 From: Evils Date: Mon, 18 May 2020 19:18:34 +0200 Subject: [PATCH 2/2] sway-contrib.inactive-windows-transparency: init at sway-unwrapped.version --- .../window-managers/sway/contrib.nix | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pkgs/applications/window-managers/sway/contrib.nix b/pkgs/applications/window-managers/sway/contrib.nix index 6ab8ea4ec8ec..e2c27fb470f7 100644 --- a/pkgs/applications/window-managers/sway/contrib.nix +++ b/pkgs/applications/window-managers/sway/contrib.nix @@ -1,4 +1,5 @@ { stdenv + , fetchurl , coreutils , makeWrapper @@ -9,6 +10,8 @@ , slurp , grim , jq + +, python3Packages }: { @@ -76,4 +79,29 @@ grimshot = stdenv.mkDerivation rec { }; }; + +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"; + }; +}; + }