Skip to content

feat(config): Add window count and workspace pattern support for dynamic gaps#1264

Closed
xand3r40r93 wants to merge 0 commit intonikitabobko:mainfrom
xand3r40r93:main
Closed

feat(config): Add window count and workspace pattern support for dynamic gaps#1264
xand3r40r93 wants to merge 0 commit intonikitabobko:mainfrom
xand3r40r93:main

Conversation

@xand3r40r93
Copy link
Copy Markdown

Enhance DynamicConfigValue to support window count and workspace pattern matching in per-monitor configurations. This allows for more granular control over gaps based on the number of windows and workspace names.

Key changes:

  • Add windows and workspace parameters for PerMonitorValue
  • Implement window count aware gap configurations
  • Add workspace pattern matching support
  • Update documentation with new configuration examples
  • Add comprehensive test coverage

default-config.toml

# Gaps between windows (inner-*) and between monitor edges (outer-*).
# Possible values:
# - Constant:     gaps.outer.top = 8
# - Per monitor:  gaps.outer.top = [
#     # Match specific monitor with window count and workspace
#     { monitor.main = { value = 16, windows = 1, workspace = "[123]" } },
#     # Match specific monitor with window count only
#     { monitor.main = { value = 32, windows = 2 } },
#     # Match specific monitor with workspace only
#     { monitor.secondary = { value = 24, workspace = "[^B]" } },
#     # Match specific monitor without conditions
#     { monitor."some-pattern" = 32 },
#     24  # default value when there is no match
# ]
#
# Parameters:
# - value:     The gap size in pixels
# - windows:   (optional) Apply this value only when the monitor has exactly this many windows
# - workspace: (optional) Apply this value only when the workspace name matches this regex pattern
#
# When multiple rules match:
# 1. Rule with matching windows AND workspace has highest priority
# 2. Rule with matching windows only has second priority
# 3. Rule with matching workspace only has third priority
# 4. Rule without conditions has fourth priority
# 5. Default value is used if no rules match
#
# Monitor pattern is the same as for 'workspace-to-monitor-force-assignment'.
# See: https://nikitabobko.github.io/AeroSpace/guide#assign-workspaces-to-monitors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant