not quite there
This commit is contained in:
		| @@ -69,8 +69,8 @@ | ||||
|  | ||||
|       binde = [ | ||||
|         # Fn keys | ||||
|         ", code:232, exec, brightnessctl set +5%" | ||||
|         ", code:233, exec, brightnessctl set -5%" | ||||
|         ", code:232, exec, brightnessctl set -5%" | ||||
|         ", code:231, exec, brightnessctl set +5%" | ||||
|         ", XF86AudioRaiseVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%+" | ||||
|         ", XF86AudioLowerVolume, exec, wpctl set-volume -l 1 @DEFAULT_AUDIO_SINK@ 5%-" | ||||
|         ", XF86AudioMute, exec, wpctl set-mute @DEFAULT_AUDIO_SINK@ toggle" | ||||
|   | ||||
| @@ -4,23 +4,30 @@ | ||||
|  ... | ||||
| }: | ||||
| with lib; let | ||||
|   # load the wallpapers from the wallpapers directory | ||||
|   wallpapers = builtins.readDir ../../../wallpapers; | ||||
|   # load the wallpapers from the wallpapers directory - this gives a set with the folder content | ||||
|   dirContent = builtins.readDir ../../../wallpapers; | ||||
|   # only keep regular (the true files) as a list | ||||
|   # loop over the set and keep the values where the key is "regular" | ||||
|   wallpapersIntermediate = attrsToList dirContent; | ||||
|   # remove the attr, keep the value | ||||
|   wallpapers = map (x: x.value) wallpapersIntermediate; | ||||
|  | ||||
|   wallpaperString = lib.strings.concatMapStrings (x: " " + x) wallpapers; | ||||
|  | ||||
|   # script that picks a random wallpaper from the array and sets it as the desktop background | ||||
|   monitor = ""; # leave empty to set the wallpaper on all monitors | ||||
|  | ||||
|   randomizer = pkgs.writeShellScriptBin "wallpaperRandomizer" '' | ||||
|     wallpaper=$(shuf -n 1 -e ${wallpapers[@]}) | ||||
|   wallpaperRandomizer = pkgs.writeShellScriptBin "wallpaperRandomizer" '' | ||||
|     wallpaper=$(shuf -n 1 -e ${wallpaperString}) | ||||
|     hyprctl hyprpaper unload all | ||||
|     hyprctl hyprpaper preload $wallpaper | ||||
|     hyprctl hyprpaper wallpaper "${monitor},${wallpaper}" | ||||
|     hyprctl hyprpaper wallpaper "${monitor},$wallpaper" | ||||
|   ''; | ||||
|  | ||||
| in { | ||||
|   home.packages = [wallpaperRandomizer]; | ||||
|  | ||||
|    | ||||
|  | ||||
|  | ||||
|   services.hyprpaper = { | ||||
|     enable = true; | ||||
| @@ -56,4 +63,4 @@ in { | ||||
|       Install = {WantedBy = ["timers.target"];}; | ||||
|     }; | ||||
|   }; | ||||
| } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user