added random hyprpaper script and options
hyprpaper: added script for a random background every 15mins
|
@ -1,5 +1,7 @@
|
|||
{ pkgs, lib, config, ... }: {
|
||||
|
||||
imports = [ ./hyprpaper-random.nix ];
|
||||
|
||||
options = {
|
||||
desktopEnv.hyprland.hyprpaper.enable =
|
||||
lib.mkEnableOption "Enables hyprpaper and assorted wallpapers.";
|
||||
|
@ -10,13 +12,29 @@
|
|||
# Packages that should be installed to the user profile.
|
||||
home.packages = with pkgs; [ hyprpaper ];
|
||||
|
||||
desktopEnv.hyprland.hyprpaper.randomWallpaper.enable = lib.mkDefault true;
|
||||
|
||||
xdg.configFile."hypr/hyprpaper.conf".source = ./hyprpaper.conf;
|
||||
|
||||
xdg.configFile."hypr/wallpapers/greenCity.jpg".source =
|
||||
./wallpapers/greenCity.jpg;
|
||||
xdg.configFile."hypr/wallpapers/evening-sky.png".source =
|
||||
./wallpapers/evening-sky.png;
|
||||
xdg.configFile."hypr/wallpapers/jr-korpa-9XngoIpxcEo-unsplash.jpg".source =
|
||||
./wallpapers/jr-korpa-9XngoIpxcEo-unsplash.jpg;
|
||||
xdg.configFile."hypr/wallpapers/salty-justice-NOMebOREvtc-unsplash.jpg".source =
|
||||
./wallpapers/salty-justice-NOMebOREvtc-unsplash.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-6d7xmx.jpg".source =
|
||||
./wallpapers/wallhaven-6d7xmx.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-83v96o.png".source =
|
||||
./wallpapers/wallhaven-83v96o.png;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-285rjm.jpg".source =
|
||||
./wallpapers/wallhaven-285rjm.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-4219wy.jpg".source =
|
||||
./wallpapers/wallhaven-4219wy.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-4267k6.jpg".source =
|
||||
./wallpapers/wallhaven-4267k6.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-d6ggel.jpg".source =
|
||||
./wallpapers/wallhaven-d6ggel.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-q2o2w5.jpg".source =
|
||||
./wallpapers/wallhaven-q2o2w5.jpg;
|
||||
xdg.configFile."hypr/wallpapers/wallhaven-zm7x5o.jpg".source =
|
||||
./wallpapers/wallhaven-zm7x5o.jpg;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
{ pkgs, lib, config, ... }:
|
||||
|
||||
let
|
||||
hyprpaper-random = pkgs.writeShellScriptBin "hyprpaper-random" ''
|
||||
directory=${config.home.homeDirectory}/.config/hypr/wallpapers
|
||||
monitor=`hyprctl monitors | grep Monitor | awk '{print $2}'`
|
||||
|
||||
if [ -d "$directory" ]; then
|
||||
while true; do
|
||||
sleep 30
|
||||
hyprctl hyprpaper unload all
|
||||
for m in ''${monitor[@]}; do
|
||||
random_background=$(ls $directory/* | shuf -n 1)
|
||||
hyprctl hyprpaper preload $random_background
|
||||
hyprctl hyprpaper wallpaper "$m,$random_background"
|
||||
done
|
||||
sleep 870
|
||||
done
|
||||
fi
|
||||
'';
|
||||
in {
|
||||
options = {
|
||||
desktopEnv.hyprland.hyprpaper.randomWallpaper.enable =
|
||||
lib.mkEnableOption "Enables hyprpaper random wallpaper script.";
|
||||
};
|
||||
|
||||
config =
|
||||
lib.mkIf config.desktopEnv.hyprland.hyprpaper.randomWallpaper.enable {
|
||||
|
||||
# Packages that should be installed to the user profile.
|
||||
home.packages = with pkgs; [ hyprpaper-random ];
|
||||
|
||||
wayland.windowManager.hyprland.extraConfig = "exec-once = ${hyprpaper-random}/bin/hyprpaper-random";
|
||||
};
|
||||
}
|
|
@ -1,6 +1,4 @@
|
|||
preload = ~/.config/hypr/wallpapers/jr-korpa-9XngoIpxcEo-unsplash.jpg
|
||||
preload = ~/.config/hypr/wallpapers/salty-justice-NOMebOREvtc-unsplash.jpg
|
||||
preload = ~/.config/hypr/wallpapers/tokyoGreen.jpg
|
||||
|
||||
wallpaper = ,~/.config/hypr/wallpapers/jr-korpa-9XngoIpxcEo-unsplash.jpg
|
||||
|
||||
|
|
After Width: | Height: | Size: 4.3 MiB |
Before Width: | Height: | Size: 4.1 MiB |
Before Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 716 KiB |
After Width: | Height: | Size: 1.4 MiB |
After Width: | Height: | Size: 3 MiB |
After Width: | Height: | Size: 4.6 MiB |
After Width: | Height: | Size: 5.6 MiB |
After Width: | Height: | Size: 2.4 MiB |
After Width: | Height: | Size: 4.7 MiB |
After Width: | Height: | Size: 4.1 MiB |
|
@ -13,6 +13,8 @@
|
|||
|
||||
home.stateVersion = "23.11";
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
desktopEnv.hyprland.hyprpaper.randomWallpaper.enable = false;
|
||||
};
|
||||
|
||||
users.users.aly.hashedPassword =
|
||||
|
|