Skip to content

Commit

Permalink
Add support for additional window tiling options
Browse files Browse the repository at this point in the history
This adds support for the following defaults:

- com.apple.WindowManager.EnableTilingByEdgeDrag
- com.apple.WindowManager.EnableTopTilingByEdgeDrag
- com.apple.WindowManager.EnableTilingOptionAccelerator
  • Loading branch information
belak committed Jan 12, 2025
1 parent 57733bd commit 3f4c2a6
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
27 changes: 26 additions & 1 deletion modules/system/defaults/WindowManager.nix
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,36 @@ with lib;
Hide items in Stage Manager.
'';
};

system.defaults.WindowManager.EnableTilingByEdgeDrag = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Enable dragging windows to screen edges to tile them.
'';
};

system.defaults.WindowManager.EnableTopTilingByEdgeDrag = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Enable dragging windows to the menu bar to fill the screen.
'';
};

system.defaults.WindowManager.EnableTilingOptionAccelerator = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Enable holding alt to tile windows.
'';
};

system.defaults.WindowManager.EnableTiledWindowMargins = mkOption {
type = types.nullOr types.bool;
default = null;
description = ''
Enable Window Margins. The default is true.
Enable window margins when tiling windows.
'';
};

Expand Down
15 changes: 15 additions & 0 deletions tests/fixtures/system-defaults-write/activate-user.txt
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,21 @@ defaults write com.apple.WindowManager 'EnableTiledWindowMargins' $'<?xml versio
<plist version="1.0">
<true/>
</plist>'
defaults write com.apple.WindowManager 'EnableTilingByEdgeDrag' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<true/>
</plist>'
defaults write com.apple.WindowManager 'EnableTilingOptionAccelerator' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<true/>
</plist>'
defaults write com.apple.WindowManager 'EnableTopTilingByEdgeDrag' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<true/>
</plist>'
defaults write com.apple.WindowManager 'GloballyEnabled' $'<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
Expand Down
3 changes: 3 additions & 0 deletions tests/system-defaults-write.nix
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@
system.defaults.WindowManager.AppWindowGroupingBehavior = true;
system.defaults.WindowManager.StandardHideDesktopIcons = false;
system.defaults.WindowManager.HideDesktop = false;
system.defaults.WindowManager.EnableTilingByEdgeDrag = true;
system.defaults.WindowManager.EnableTopTilingByEdgeDrag = true;
system.defaults.WindowManager.EnableTilingOptionAccelerator = true;
system.defaults.WindowManager.EnableTiledWindowMargins = true;
system.defaults.WindowManager.StandardHideWidgets = true;
system.defaults.WindowManager.StageManagerHideWidgets = true;
Expand Down

0 comments on commit 3f4c2a6

Please sign in to comment.