Compare

1d64a259eb2f377b7b7dc36263eaf33d4a7cf28c .. 06f4083f0d8f521dfde6e1961de8354b6df4a92e · 1 commits

Changed files

Commits

HashSubjectAuthorDate
06f4083f another new way for wallpapers and lock screen keyboard shortcut Ryan Schanzenbacher
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