try setting wallpapers once more

This commit is contained in:
Remy Moll 2025-03-11 14:59:46 +01:00
parent f6f3a19d18
commit 8eed29719d

View File

@ -4,23 +4,21 @@
... ...
}: }:
with lib; let with lib; let
# wallpapers = builtins.readDir ../../../wallpapers; # load the wallpapers from the wallpapers directory
wallpapers = builtins.readDir ../../../wallpapers;
# wallpaperBashArray = "(\"${strings.concatStrings (strings.intersperse "\" \"" (map (wallpaper: ../../../wallpapers + "/" + wallpaper) (attrNames wallpapers)))}\")"; # script that picks a random wallpaper from the array and sets it as the desktop background
# wallpaperRandomizer = pkgs.writeShellScriptBin "wallpaperRandomizer" '' monitor = ""; # leave empty to set the wallpaper on all monitors
# wallpapers=${wallpaperBashArray}
# rand=$[$RANDOM % ''${#wallpapers[@]}] randomizer = pkgs.writeShellScriptBin "wallpaperRandomizer" ''
# wallpaper=''${wallpapers[$rand]} wallpaper=$(shuf -n 1 -e ${wallpapers[@]})
hyprctl hyprpaper unload all
hyprctl hyprpaper preload $wallpaper
hyprctl hyprpaper wallpaper "${monitor},${wallpaper}"
'';
# monitor=(`hyprctl monitors | grep Monitor | awk '{print $2}'`)
# hyprctl hyprpaper unload all
# hyprctl hyprpaper preload $wallpaper
# for m in ''${monitor[@]}; do
# hyprctl hyprpaper wallpaper "$m,$wallpaper"
# done
# '';
in { in {
# home.packages = [wallpaperRandomizer]; home.packages = [wallpaperRandomizer];
@ -30,39 +28,32 @@ in {
settings = { settings = {
ipc = "off"; ipc = "off";
splash = false; splash = false;
preload = [
"${../../../wallpapers/magicpattern-87PP9Zd7MNo-unsplash.jpg}"
];
wallpaper = [
",${../../../wallpapers/magicpattern-87PP9Zd7MNo-unsplash.jpg}"
];
}; };
}; };
# systemd.user = { systemd.user = {
# services.wallpaperRandomizer = { services.wallpaperRandomizer = {
# Install = {WantedBy = ["graphical-session.target"];}; Install = {WantedBy = ["graphical-session.target"];};
# Unit = { Unit = {
# Description = "Set random desktop background using hyprpaper"; Description = "Set random desktop background using hyprpaper";
# After = ["graphical-session-pre.target"]; After = ["graphical-session-pre.target"];
# PartOf = ["graphical-session.target"]; PartOf = ["graphical-session.target"];
# }; };
# Service = { Service = {
# Type = "oneshot"; Type = "oneshot";
# ExecStart = "${wallpaperRandomizer}/bin/wallpaperRandomizer"; ExecStart = "${wallpaperRandomizer}/bin/wallpaperRandomizer";
# IOSchedulingClass = "idle"; IOSchedulingClass = "idle";
# }; };
# }; };
# timers.wallpaperRandomizer = { timers.wallpaperRandomizer = {
# Unit = {Description = "Set random desktop background using hyprpaper on an interval";}; Unit = {Description = "Set random desktop background using hyprpaper on an interval";};
# Timer = {OnUnitActiveSec = "6h";}; Timer = {OnUnitActiveSec = "6h";};
# Install = {WantedBy = ["timers.target"];}; Install = {WantedBy = ["timers.target"];};
# }; };
# }; };
} }