aboutsummaryrefslogtreecommitdiff
path: root/parser-specs
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2022-10-30 16:19:04 +0100
committerMichael Stapelberg <stapelberg@users.noreply.github.com>2022-11-01 17:55:46 +0100
commitb825dc124a33f247cf35efd5e2d0646003a16f23 (patch)
tree0a1e657f29d85dd451acc5ad55b0208770f6e0ca /parser-specs
parent0b89d4b2a7ae84a852a707d71cf2697e55581ee7 (diff)
downloadi3-b825dc124a33f247cf35efd5e2d0646003a16f23.tar.gz
i3-b825dc124a33f247cf35efd5e2d0646003a16f23.zip
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
Diffstat (limited to 'parser-specs')
-rw-r--r--parser-specs/commands.spec18
-rw-r--r--parser-specs/config.spec40
2 files changed, 54 insertions, 4 deletions
diff --git a/parser-specs/commands.spec b/parser-specs/commands.spec
index 486f20dd..c618dfda 100644
--- a/parser-specs/commands.spec
+++ b/parser-specs/commands.spec
@@ -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)
diff --git a/parser-specs/config.spec b/parser-specs/config.spec
index e8ea2f9d..c918f142 100644
--- a/parser-specs/config.spec
+++ b/parser-specs/config.spec
@@ -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