summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/RyanMac/configuration.nix22
-rw-r--r--modules/darwin/random-wallpaper.nix8
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 {
237 ShowStatusBar = true; 237 ShowStatusBar = true;
238 }; 238 };
239 239
240 spaces = {
241 "spans-displays" = false; # independent spaces per display
242 };
243
240 # Login Window Settings 244 # Login Window Settings
241 loginwindow = { 245 loginwindow = {
242 GuestEnabled = false; 246 GuestEnabled = false;
@@ -274,6 +278,11 @@ in {
274 NSGlobalDomain = { 278 NSGlobalDomain = {
275 # Always show menu bar 279 # Always show menu bar
276 AppleMenuBarVisibleInFullscreen = true; 280 AppleMenuBarVisibleInFullscreen = true;
281
282 # Option + L lock
283 NSUserKeyEquivalents = {
284 "Lock Screen" = "~l";
285 };
277 }; 286 };
278 287
279 "com.apple.Accessibility" = { 288 "com.apple.Accessibility" = {
@@ -311,6 +320,19 @@ in {
311 # this is fragile so it goes at the bottom 320 # this is fragile so it goes at the bottom
312 echo "Reloading skhd..." 321 echo "Reloading skhd..."
313 sudo -iu ${username} ${pkgs.skhd}/bin/skhd -r 322 sudo -iu ${username} ${pkgs.skhd}/bin/skhd -r
323
324 # 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
325 MARK="/opt/.nix-complete"
326 if [ ! -f "$MARK" ]; then
327 echo "o0o0o0o0o0o MacOS Initial Deploy Notes o0o0o0o0o0o"
328 echo "--------------------------------------------------"
329 echo "The following actions must be taken since they are not configurable by Nix. This must be done only ONCE."
330 echo ""
331 echo "1. Create 9 spaces."
332 echo "2. Set a wallpaper as visible in all spaces."
333 echo "--------------------------------------------------"
334 fi
335 touch "$MARK"
314 ''; 336 '';
315 337
316} 338}
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
3 cfg = config.local.randomWallpaper; 3 cfg = config.local.randomWallpaper;
4 script = pkgs.writeShellApplication { 4 script = pkgs.writeShellApplication {
5 name = "set-random-wallpaper"; 5 name = "set-random-wallpaper";
6 runtimeInputs = [ pkgs.coreutils pkgs.findutils pkgs.desktoppr]; 6 runtimeInputs = [ pkgs.coreutils pkgs.findutils ];
7 text = '' 7 text = ''
8 set -euo pipefail 8 set -euo pipefail
9 img=$(find "${cfg.directory}" \ 9 img=$(find "${cfg.directory}" \
@@ -11,7 +11,11 @@ let
11 | shuf -n1) 11 | shuf -n1)
12 [ -n "$img" ] || exit 0 12 [ -n "$img" ] || exit 0
13 #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\"" 13 #/usr/bin/osascript -e "tell application \"System Events\" to tell every desktop to set picture to \"$img\""
14 desktoppr "$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
15 ''; 19 '';
16 }; 20 };
17in 21in