Merge gaps support as-is

This code was copied over unmodified from https://github.com/Airblader/i3-gaps.

I have split out the differences between i3-gaps and i3 into three areas:
1. Gaps
2. i3bar height
3. rgba colors
This commit is contained in:
Michael Stapelberg
2022-10-30 16:19:04 +01:00
committed by Michael Stapelberg
parent 0b89d4b2a7
commit b825dc124a
22 changed files with 668 additions and 33 deletions

View File

@ -43,6 +43,7 @@ state INITIAL:
'title_window_icon' -> TITLE_WINDOW_ICON
'mode' -> MODE
'bar' -> BAR
'gaps' -> GAPS
state CRITERIA:
ctype = 'class' -> CRITERION
@ -95,6 +96,23 @@ state BORDER:
'1pixel'
-> call cmd_border("pixel", 1)
# gaps inner|outer|horizontal|vertical|top|right|bottom|left [current] [set|plus|minus|toggle] <px>
state GAPS:
type = 'inner', 'outer', 'horizontal', 'vertical', 'top', 'right', 'bottom', 'left'
-> GAPS_WITH_TYPE
state GAPS_WITH_TYPE:
scope = 'current', 'all'
-> GAPS_WITH_SCOPE
state GAPS_WITH_SCOPE:
mode = 'plus', 'minus', 'set', 'toggle'
-> GAPS_WITH_MODE
state GAPS_WITH_MODE:
value = word
-> call cmd_gaps($type, $scope, $mode, $value)
state BORDER_WIDTH:
end
-> call cmd_border($border_style, -1)

View File

@ -25,6 +25,9 @@ state INITIAL:
'bar' -> BARBRACE
'font' -> FONT
'mode' -> MODENAME
'gaps' -> GAPS
'smart_borders' -> SMART_BORDERS
'smart_gaps' -> SMART_GAPS
'floating_minimum_size' -> FLOATING_MINIMUM_SIZE_WIDTH
'floating_maximum_size' -> FLOATING_MAXIMUM_SIZE_WIDTH
'floating_modifier' -> FLOATING_MODIFIER
@ -65,6 +68,32 @@ state IGNORE_LINE:
line
-> INITIAL
# gaps inner|outer|horizontal|vertical|top|right|bottom|left <px>
state GAPS:
scope = 'inner', 'outer', 'horizontal', 'vertical', 'top', 'right', 'bottom', 'left'
-> GAPS_WITH_SCOPE
state GAPS_WITH_SCOPE:
value = number
-> call cfg_gaps($workspace, $scope, &value)
# smart_borders true|false
# smart_borders no_gaps
state SMART_BORDERS:
enabled = '1', 'yes', 'true', 'on', 'enable', 'active'
-> call cfg_smart_borders($enabled)
enabled = 'no_gaps'
-> call cfg_smart_borders($enabled)
# smart_gaps on|off
state SMART_GAPS:
enabled = '1', 'yes', 'true', 'on', 'enable', 'active'
-> call cfg_smart_gaps($enabled)
enabled = '0', 'no', 'false', 'off', 'disable', 'inactive'
-> call cfg_smart_gaps($enabled)
enabled = 'inverse_outer'
-> call cfg_smart_gaps($enabled)
# include <pattern>
state INCLUDE:
pattern = string
@ -135,10 +164,10 @@ state DEFAULT_BORDER_PIXELS_PX:
end
-> call cfg_default_border($windowtype, $border, &width)
# hide_edge_borders <none|vertical|horizontal|both|smart>
# hide_edge_borders <none|vertical|horizontal|both|smart|no_gaps>
# also hide_edge_borders <bool> for compatibility
state HIDE_EDGE_BORDERS:
hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart'
hide_borders = 'none', 'vertical', 'horizontal', 'both', 'smart_no_gaps', 'smart'
-> call cfg_hide_edge_borders($hide_borders)
hide_borders = '1', 'yes', 'true', 'on', 'enable', 'active'
-> call cfg_hide_edge_borders($hide_borders)
@ -297,13 +326,16 @@ state FOCUS_ON_WINDOW_ACTIVATION:
-> call cfg_focus_on_window_activation($mode)
# workspace <workspace> output <output>
# workspace <workspace> gaps inner|outer <px>
state WORKSPACE:
workspace = word
-> WORKSPACE_OUTPUT
-> WORKSPACE_COMMAND
state WORKSPACE_OUTPUT:
state WORKSPACE_COMMAND:
'output'
-> WORKSPACE_OUTPUT_WORD
'gaps'
-> GAPS
state WORKSPACE_OUTPUT_WORD:
output = word