summary refs log tree commit diff
diff options
context:
space:
mode:
authorEvils <evils.devils@protonmail.com>2020-05-14 19:36:23 +0200
committerEvils <evils.devils@protonmail.com>2020-06-11 07:37:37 +0200
commit40c3a8eeadcf096236d2f96727cde17ea35d8e22 (patch)
treef3d0e475c4d671f95e99cde78b6208d07ca45cfe
parentea76532bc86185192fbfbfba82d6c5b375f5f870 (diff)
downloadnixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.tar
nixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.tar.gz
nixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.tar.bz2
nixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.tar.lz
nixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.tar.xz
nixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.tar.zst
nixpkgs-40c3a8eeadcf096236d2f96727cde17ea35d8e22.zip
sway-contrib.grimshot: init at 2020-05-08
-rw-r--r--pkgs/applications/window-managers/sway/contrib.nix79
-rw-r--r--pkgs/top-level/all-packages.nix1
2 files changed, 80 insertions, 0 deletions
diff --git a/pkgs/applications/window-managers/sway/contrib.nix b/pkgs/applications/window-managers/sway/contrib.nix
new file mode 100644
index 00000000000..6ab8ea4ec8e
--- /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 cc405432704..f73e398aab0 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 { };