wow
Some checks failed
CI / check (push) Has been cancelled
CI / ida (push) Has been cancelled
CI / cpt (push) Has been cancelled
CI / build-nixos (ena) (push) Has been cancelled
CI / build-nixos (hako) (push) Has been cancelled
CI / build-nixos (kazusa) (push) Has been cancelled
CI / build-nixos (mizuki) (push) Has been cancelled
Some checks failed
CI / check (push) Has been cancelled
CI / ida (push) Has been cancelled
CI / cpt (push) Has been cancelled
CI / build-nixos (ena) (push) Has been cancelled
CI / build-nixos (hako) (push) Has been cancelled
CI / build-nixos (kazusa) (push) Has been cancelled
CI / build-nixos (mizuki) (push) Has been cancelled
This commit is contained in:
commit
bbac123a8d
144 changed files with 7059 additions and 0 deletions
42
hosts/machine/kanade/modules/mac/wallpaper.nix
Normal file
42
hosts/machine/kanade/modules/mac/wallpaper.nix
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
wallpaper = "${inputs.self}/assets/wallpaper/wallpaper1.jpg";
|
||||
setWallpaperScript = pkgs.writeShellScriptBin "set-wallpaper-script" ''
|
||||
set -eu
|
||||
|
||||
# System Events runs in the logged-in Aqua session and updates every Space.
|
||||
# Retry because launch agents can start before the desktop is fully ready.
|
||||
for attempt in {1..12}; do
|
||||
if /usr/bin/osascript <<'APPLESCRIPT'
|
||||
tell application "System Events"
|
||||
tell every desktop
|
||||
set picture to "${wallpaper}"
|
||||
end tell
|
||||
end tell
|
||||
APPLESCRIPT
|
||||
then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
/bin/sleep 5
|
||||
done
|
||||
|
||||
exit 1
|
||||
'';
|
||||
in
|
||||
{
|
||||
environment.systemPackages = [ setWallpaperScript ];
|
||||
|
||||
launchd.user.agents.set-wallpaper = {
|
||||
command = "${setWallpaperScript}/bin/set-wallpaper-script";
|
||||
serviceConfig = {
|
||||
RunAtLoad = true;
|
||||
ProcessType = "Interactive";
|
||||
LimitLoadToSessionType = "Aqua";
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue