about summary refs log tree commit diff
path: root/configuration.nix
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@gmail.com>2017-10-15T18·01+0200
committerVincent Ambo <tazjin@gmail.com>2017-10-15T18·01+0200
commita11aca65a58427fa6d54619b4caa94d073a742b4 (patch)
tree26e314c36107aad1930f61aeb9ed6f075ca0634c /configuration.nix
parentf771c2a643387f75ee3bf9b71cc3039ef92c0a7f (diff)
fix: 'Manually' randomize feh wallpapers
The wallpaper folder is now in git and feh will pick any random file in
the folder that it is pointed at, leading to it constantly failing while
trying to set git objects as the wallpaper.

This uses  manual 'fd | shuf | xargs' pipeline for the same purpose.
Diffstat (limited to 'configuration.nix')
-rw-r--r--configuration.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/configuration.nix b/configuration.nix
index c88739298ca9..a7e357323249 100644
--- a/configuration.nix
+++ b/configuration.nix
@@ -69,7 +69,7 @@ in {
     shell = pkgs.fish;
     packages = with pkgs; [
       jetbrains.idea-community pavucontrol spotify xclip tdesktop
-      rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin
+      rofi rofi-pass alacritty i3lock unstable.firefox-beta-bin fd
     ];
   };
 
@@ -88,7 +88,8 @@ in {
     description = "Randomly set wallpaper via feh";
     serviceConfig = {
       Type = "oneshot";
-      ExecStart = "${pkgs.feh}/bin/feh --recursive --randomize --bg-fill %h/wallpapers";
+      WorkingDirectory = "%h/wallpapers";
+      ExecStart = "${pkgs.bash}/bin/bash -c '${pkgs.fd}/bin/fd -atf | shuf | head -n1 | ${pkgs.findutils}/bin/xargs ${pkgs.feh}/bin/feh --bg-fill'";
     };
   };