From 06f4083f0d8f521dfde6e1961de8354b6df4a92e Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Sun, 21 Jun 2026 23:59:30 -0400 Subject: another new way for wallpapers and lock screen keyboard shortcut --- hosts/RyanMac/configuration.nix | 22 ++++++++++++++++++++++ modules/darwin/random-wallpaper.nix | 8 ++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/hosts/RyanMac/configuration.nix b/hosts/RyanMac/configuration.nix index 66ad874..c964d97 100644 --- a/hosts/RyanMac/configuration.nix +++ b/hosts/RyanMac/configuration.nix @@ -237,6 +237,10 @@ in { ShowStatusBar = true; }; + spaces = { + "spans-displays" = false; # independent spaces per display + }; + # Login Window Settings loginwindow = { GuestEnabled = false; @@ -274,6 +278,11 @@ in { NSGlobalDomain = { # Always show menu bar AppleMenuBarVisibleInFullscreen = true; + + # Option + L lock + NSUserKeyEquivalents = { + "Lock Screen" = "~l"; + }; }; "com.apple.Accessibility" = { @@ -311,6 +320,19 @@ in { # this is fragile so it goes at the bottom echo "Reloading skhd..." sudo -iu ${username} ${pkgs.skhd}/bin/skhd -r + + # Notes if we are running for the first time and writes a message for actions that may need to be done on macOS or linux + MARK="/opt/.nix-complete" + if [ ! -f "$MARK" ]; then + echo "o0o0o0o0o0o MacOS Initial Deploy Notes o0o0o0o0o0o" + echo "--------------------------------------------------" + echo "The following actions must be taken since they are not configurable by Nix. This must be done only ONCE." + echo "" + echo "1. Create 9 spaces." + echo "2. Set a wallpaper as visible in all spaces." + echo "--------------------------------------------------" + fi + touch "$MARK" ''; } diff --git a/modules/darwin/random-wallpaper.nix b/modules/darwin/random-wallpaper.nix index 75248b7..793096f 100644 --- a/modules/darwin/random-wallpaper.nix +++ b/modules/darwin/random-wallpaper.nix @@ -3,7 +3,7 @@ let cfg = config.local.randomWallpaper; script = pkgs.writeShellApplication { name = "set-random-wallpaper"; - runtimeInputs = [ pkgs.coreutils pkgs.findutils pkgs.desktoppr]; + runtimeInputs = [ pkgs.coreutils pkgs.findutils ]; text = '' set -euo pipefail img=$(find "${cfg.directory}" \ @@ -11,7 +11,11 @@ let | shuf -n1) [ -n "$img" ] || exit 0 #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\"" - desktoppr "$img" + #desktoppr "$img" + URL="file://$img" + PLIST="${config.users.users.${config.system.primaryUser}.home}/Library/Application Support/com.apple.wallpaper/Store/Index.plist" + /usr/libexec/PlistBuddy -c "set AllSpacesAndDisplays:Desktop:Content:Choices:0:Files:0:relative $URL" "$PLIST" + /usr/bin/killall WallpaperAgent 2>/dev/null || true ''; }; in -- cgit v1.3