Skip to content

Commit

Permalink
(feature) Add Stage Manager (com.apple.WindowManager) settings as sys…
Browse files Browse the repository at this point in the history
…tem.defaults.windowmanager

All credits go to @AlexOwl. Their [PR](#505)
looked abandonned so I reported their changes and addressed the change
requests.
  • Loading branch information
malko42 committed Jul 11, 2024
1 parent cf297a8 commit 6cf027c
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/module-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
./system/defaults/trackpad.nix
./system/defaults/universalaccess.nix
./system/defaults/ActivityMonitor.nix
./system/defaults/WindowManager.nix
./system/etc.nix
./system/keyboard.nix
./system/launchd.nix
Expand Down
3 changes: 3 additions & 0 deletions modules/system/defaults-write.nix
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ let
trackpadBluetooth = defaultsToList "com.apple.driver.AppleBluetoothMultitouch.trackpad" cfg.trackpad;
universalaccess = defaultsToList "com.apple.universalaccess" cfg.universalaccess;
ActivityMonitor = defaultsToList "com.apple.ActivityMonitor" cfg.ActivityMonitor;
WindowManager = defaultsToList "com.apple.WindowManager" cfg.WindowManager;
CustomUserPreferences = flatten (mapAttrsToList (name: value: defaultsToList name value) cfg.CustomUserPreferences);
CustomSystemPreferences = flatten (mapAttrsToList (name: value: defaultsToList name value) cfg.CustomSystemPreferences);

Expand Down Expand Up @@ -85,6 +86,7 @@ in
universalaccess
ActivityMonitor
CustomUserPreferences
WindowManager
]
''
# Set defaults
Expand All @@ -107,6 +109,7 @@ in
${concatStringsSep "\n" universalaccess}
${concatStringsSep "\n" ActivityMonitor}
${concatStringsSep "\n" CustomUserPreferences}
${concatStringsSep "\n" WindowManager}
'';

};
Expand Down
43 changes: 43 additions & 0 deletions modules/system/defaults/WindowManager.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{ config, lib, ... }:

with lib;

{
options = {
system.defaults.WindowManager.GloballyEnabled = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
# Apple menu > System Settings > Dekstop and Dock > Stage Manager
Stage Manager arranges your recent windows into a single strip for reduced clutter and quick access. Default is false.
'';
};

system.defaults.WindowManager.GloballyEnabledEver = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
# Apple menu > System Settings > Dekstop and Dock > Stage Manager
Default is true.
'';
};

system.defaults.WindowManager.AutoHide = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
# Apple menu > System Settings > Dekstop and Dock > Stage Manager
Do not show Recent Apps. Default is false.
'';
};

system.defaults.WindowManager.HideDesktop = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
# Apple menu > System Settings > Dekstop and Dock > Stage Manager
Hide dekstop items. Default is false.
'';
};
};
}

0 comments on commit 6cf027c

Please sign in to comment.