about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pywal
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/python-modules/pywal
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/pywal')
-rw-r--r--nixpkgs/pkgs/development/python-modules/pywal/convert.patch21
-rw-r--r--nixpkgs/pkgs/development/python-modules/pywal/default.nix33
-rw-r--r--nixpkgs/pkgs/development/python-modules/pywal/feh.patch39
3 files changed, 93 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/pywal/convert.patch b/nixpkgs/pkgs/development/python-modules/pywal/convert.patch
new file mode 100644
index 000000000000..999bc1abeaf1
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pywal/convert.patch
@@ -0,0 +1,21 @@
+diff --git a/pywal/backends/wal.py b/pywal/backends/wal.py
+index a75fdc5..4339680 100644
+--- a/pywal/backends/wal.py
++++ b/pywal/backends/wal.py
+@@ -21,15 +21,7 @@ def imagemagick(color_count, img, magick_command):
+
+ def has_im():
+     """Check to see if the user has im installed."""
+-    if shutil.which("magick"):
+-        return ["magick", "convert"]
+-
+-    if shutil.which("convert"):
+-        return ["convert"]
+-
+-    logging.error("Imagemagick wasn't found on your system.")
+-    logging.error("Try another backend. (wal --backend)")
+-    sys.exit(1)
++    return ["@convert@"]
+
+
+ def gen_colors(img):
diff --git a/nixpkgs/pkgs/development/python-modules/pywal/default.nix b/nixpkgs/pkgs/development/python-modules/pywal/default.nix
new file mode 100644
index 000000000000..00691e65225c
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pywal/default.nix
@@ -0,0 +1,33 @@
+{ lib, python3Packages, imagemagick, feh }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "pywal";
+  version = "3.2.1";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "1pj30h19ijwhmbm941yzbkgr19q06dhp9492h9nrqw1wfjfdbdic";
+  };
+
+  preCheck = ''
+    mkdir tmp
+    HOME=$PWD/tmp
+  '';
+
+  patches = [
+    ./convert.patch
+    ./feh.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace pywal/backends/wal.py --subst-var-by convert "${imagemagick}/bin/convert"
+    substituteInPlace pywal/wallpaper.py --subst-var-by feh "${feh}/bin/feh"
+  '';
+
+  meta = with lib; {
+    description = "Generate and change colorschemes on the fly. A 'wal' rewrite in Python 3.";
+    homepage = https://github.com/dylanaraps/pywal;
+    license = licenses.mit;
+    maintainers = with maintainers; [ Fresheyeball ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/python-modules/pywal/feh.patch b/nixpkgs/pkgs/development/python-modules/pywal/feh.patch
new file mode 100644
index 000000000000..985e601d6257
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/pywal/feh.patch
@@ -0,0 +1,39 @@
+commit c31faa212e09aa62c232d9008e05976b1cdc9ee5
+Author: Frederik Rietdijk <fridh@fridh.nl>
+Date:   Wed Dec 26 12:54:32 2018 +0100
+
+    nix: hardcode feh
+
+diff --git a/pywal/wallpaper.py b/pywal/wallpaper.py
+index ba61e66..fad34f7 100644
+--- a/pywal/wallpaper.py
++++ b/pywal/wallpaper.py
+@@ -47,27 +47,7 @@ def xfconf(path, img):
+ 
+ def set_wm_wallpaper(img):
+     """Set the wallpaper for non desktop environments."""
+-    if shutil.which("feh"):
+-        util.disown(["feh", "--bg-fill", img])
+-
+-    elif shutil.which("nitrogen"):
+-        util.disown(["nitrogen", "--set-zoom-fill", img])
+-
+-    elif shutil.which("bgs"):
+-        util.disown(["bgs", "-z", img])
+-
+-    elif shutil.which("hsetroot"):
+-        util.disown(["hsetroot", "-fill", img])
+-
+-    elif shutil.which("habak"):
+-        util.disown(["habak", "-mS", img])
+-
+-    elif shutil.which("display"):
+-        util.disown(["display", "-backdrop", "-window", "root", img])
+-
+-    else:
+-        logging.error("No wallpaper setter found.")
+-        return
++    return util.disown(["@feh@", "--bg-fill", img])
+ 
+ 
+ def set_desktop_wallpaper(desktop, img):