summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2018-12-26 12:57:19 +0100
committerFrederik Rietdijk <fridh@fridh.nl>2018-12-26 12:58:28 +0100
commit3f93d68ebbf7488edbb578afc905a6fc3df1747e (patch)
tree1bbc566d5b10e48218ced15f56bd36bd51bd66b1 /pkgs/development
parent302d53df2b79f48ea6e9f42e47dd17e561ff6433 (diff)
downloadnixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.tar
nixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.tar.gz
nixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.tar.bz2
nixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.tar.lz
nixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.tar.xz
nixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.tar.zst
nixpkgs-3f93d68ebbf7488edbb578afc905a6fc3df1747e.zip
python.pkgs.pywal: hardcode path to feh
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/pywal/default.nix7
-rw-r--r--pkgs/development/python-modules/pywal/feh.patch39
2 files changed, 41 insertions, 5 deletions
diff --git a/pkgs/development/python-modules/pywal/default.nix b/pkgs/development/python-modules/pywal/default.nix
index 799a018e539..00691e65225 100644
--- a/pkgs/development/python-modules/pywal/default.nix
+++ b/pkgs/development/python-modules/pywal/default.nix
@@ -9,11 +9,6 @@ python3Packages.buildPythonApplication rec {
     sha256 = "1pj30h19ijwhmbm941yzbkgr19q06dhp9492h9nrqw1wfjfdbdic";
   };
 
-  # necessary for imagemagick to be found during tests
-  buildInputs = [ imagemagick ];
-
-  makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ imagemagick feh ]}" ];
-
   preCheck = ''
     mkdir tmp
     HOME=$PWD/tmp
@@ -21,10 +16,12 @@ python3Packages.buildPythonApplication rec {
 
   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; {
diff --git a/pkgs/development/python-modules/pywal/feh.patch b/pkgs/development/python-modules/pywal/feh.patch
new file mode 100644
index 00000000000..eae2ddbefd6
--- /dev/null
+++ b/pkgs/development/python-modules/pywal/feh.patch
@@ -0,0 +1,39 @@
+commit 99ef6bfc51ee401f6762183f8e323b8306a8ce56
+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..6107305 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@/bin/feh", "--bg-fill", img])
+ 
+ 
+ def set_desktop_wallpaper(desktop, img):