gaps: allow optional px suffix

This commit is contained in:
Michael Stapelberg 2022-10-31 19:04:14 +01:00 committed by Michael Stapelberg
parent b2c696f680
commit a5791b2e64
4 changed files with 18 additions and 6 deletions

View File

@ -1455,15 +1455,15 @@ to most specific as some directives can overwrite others.
*Syntax*:
-----------------------
# Inner gaps for all windows: space between two adjacent windows (or split containers).
gaps inner <gap_size_in_px>
gaps inner <gap_size>[px]
# Outer gaps for all windows: space along the screen edges.
gaps outer|horizontal|vertical|top|left|bottom|right <gap_size_in_px>
gaps outer|horizontal|vertical|top|left|bottom|right <gap_size>[px]
# Inner and outer gaps for all windows on a specific workspace.
# <ws> can be a workspace number or name.
workspace <ws> gaps inner <gap_size_in_px>
workspace <ws> gaps outer|horizontal|vertical|top|left|bottom|right <gap_size_in_px>
workspace <ws> gaps inner <gap_size>[px]
workspace <ws> gaps outer|horizontal|vertical|top|left|bottom|right <gap_size>[px]
# Enabling “Smart Gaps” means no gaps will be shown when there is
# precisely one window or split container on the workspace.

View File

@ -111,6 +111,12 @@ state GAPS_WITH_SCOPE:
state GAPS_WITH_MODE:
value = word
-> GAPS_END
state GAPS_END:
'px'
->
end
-> call cmd_gaps($type, $scope, $mode, $value)
state BORDER_WIDTH:

View File

@ -68,13 +68,19 @@ state IGNORE_LINE:
line
-> INITIAL
# gaps inner|outer|horizontal|vertical|top|right|bottom|left <px>
# gaps inner|outer|horizontal|vertical|top|right|bottom|left <gap_size>[px]
state GAPS:
scope = 'inner', 'outer', 'horizontal', 'vertical', 'top', 'right', 'bottom', 'left'
-> GAPS_WITH_SCOPE
state GAPS_WITH_SCOPE:
value = number
-> GAPS_END
state GAPS_END:
'px'
->
end
-> call cfg_gaps($workspace, $scope, &value)
# smart_borders true|false

View File

@ -22,7 +22,7 @@ use i3test i3_config => <<EOT;
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1
gaps inner 10
gaps outer 20
gaps outer 20px
default_border pixel 0
EOT