aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorRyan Schanzenbacher <ryan@rschanz.org>2026-07-06 22:50:11 -0400
committerRyan Schanzenbacher <ryan@rschanz.org>2026-07-06 22:50:11 -0400
commit8f71fac972b4fe5a98459148d9b33d1748deaa7f (patch)
tree4889a076747ac560770ba16330a6ba6771ab6bc4 /modules
parent78690d5e544616e73562e13d0c27bd910480111c (diff)
initial simple-bar config
Diffstat (limited to 'modules')
-rw-r--r--modules/darwin/random-wallpaper.nix45
1 files changed, 0 insertions, 45 deletions
diff --git a/modules/darwin/random-wallpaper.nix b/modules/darwin/random-wallpaper.nix
deleted file mode 100644
index 793096f..0000000
--- a/modules/darwin/random-wallpaper.nix
+++ /dev/null
@@ -1,45 +0,0 @@
1{ config, lib, pkgs, ... }:
2let
3 cfg = config.local.randomWallpaper;
4 script = pkgs.writeShellApplication {
5 name = "set-random-wallpaper";
6 runtimeInputs = [ pkgs.coreutils pkgs.findutils ];
7 text = ''
8 set -euo pipefail
9 img=$(find "${cfg.directory}" \
10 -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' \) \
11 | shuf -n1)
12 [ -n "$img" ] || exit 0
13 #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\""
14 #desktoppr "$img"
15 URL="file://$img"
16 PLIST="${config.users.users.${config.system.primaryUser}.home}/Library/Application Support/com.apple.wallpaper/Store/Index.plist"
17 /usr/libexec/PlistBuddy -c "set AllSpacesAndDisplays:Desktop:Content:Choices:0:Files:0:relative $URL" "$PLIST"
18 /usr/bin/killall WallpaperAgent 2>/dev/null || true
19 '';
20 };
21in
22{
23 options.local.randomWallpaper = {
24 enable = lib.mkEnableOption "Random Rotating Wallpaper";
25 directory = lib.mkOption {
26 type = lib.types.str;
27 description = "Folder containing images";
28 };
29 interval = lib.mkOption {
30 type = lib.types.int;
31 default = 1800;
32 description = "Seconds between wallpaper changes";
33 };
34 };
35
36 config = lib.mkIf cfg.enable {
37 launchd.user.agents.random-wallpaper.serviceConfig = {
38 Label = "org.rschanz.wallpaperDaemon";
39 ProgramArguments = [ "${script}/bin/set-random-wallpaper" ];
40 StartInterval = cfg.interval;
41 RunAtLoad = true;
42 ProcessType = "Background";
43 };
44 };
45}