swayfx/sway
Brian Ashworth b277000601 Alter config variable replacement process
Currently, variables cannot contain commands and cannot span more than
one argument. This is due to variable replacement happening after
determining the handler and after splitting the config line into
arguments.

This changes the process to:
0. Check for empty lines and block boundaries
1. Split the arguments as before
2. Verify that the first argument is not a variable. If needed the
following occurs
    a. Perform variable replacement on just the first argument
    b. Join the arguments back together then split the arguments again. This is needed when the variable
contains the command and arguments for the command.
3. Determine the handler
4. If the handler is cmd_set, escape the variable name so that it does
not get replaced
5. Join the arguments back together, do variable replacement on the full
command, and split the arguments again
6. Perform any needed quote stripping or unescaping on arguments
7. Run the command handler

This allows for config snippets such as:

```
set $super bindsym Mod4
$super+a exec some-command
```

and

```
set $bg bg #ffffff solid_color
output * $bg
```
2018-11-10 21:53:10 -05:00
..
commands Use parse_boolean where possible. 2018-11-10 12:55:06 +00:00
config swaybar: show hidden bar on key event 2018-10-14 13:33:12 +01:00
desktop Use wlr_surface_get_effective_damage 2018-11-04 23:21:37 +01:00
input Add focus_follows_mouse always. (#3081) 2018-11-06 21:58:08 +01:00
tree Merge pull request #3087 from RedSoxFan/side-gaps 2018-11-08 22:41:14 +10:00
commands.c Alter config variable replacement process 2018-11-10 21:53:10 -05:00
config.c Merge pull request #3085 from 7415963987456321/master 2018-11-08 20:07:41 -05:00
criteria.c Move view marks properties to container struct 2018-11-01 18:09:51 +10:00
debug-tree.c Minor refactor of input manager 2018-10-20 13:11:43 +10:00
decoration.c Rename view_set_csd_from_client to view_update_csd_from_client 2018-09-27 22:51:37 +10:00
ipc-json.c ipc: move refresh from output to output->current_mode 2018-11-03 15:09:34 -07:00
ipc-server.c Move view marks properties to container struct 2018-11-01 18:09:51 +10:00
main.c Teardown compositor when failing to drop permissions 2018-11-01 18:50:06 +01:00
meson.build Remove raise_floating directive 2018-10-20 17:51:32 +10:00
security.c Add minimal config subsystem 2017-12-05 10:40:55 +01:00
server.c Implement the presentation-time protocol 2018-10-23 23:38:57 +02:00
sway-bar.5.scd swaybar: add documentation for hide/hidden_state subcommands 2018-10-14 13:33:12 +01:00
sway-input.5.scd Establish sway-output(5) 2018-10-14 10:52:57 -04:00
sway-output.5.scd Add relative output transform 2018-11-05 22:58:27 +00:00
sway.1.scd Establish sway-output(5) 2018-10-14 10:52:57 -04:00
sway.5.scd Update documentation for focus_follows_mouse. 2018-11-08 20:38:50 +00:00
swaynag.c Allow swaynag to be disabled 2018-10-08 09:59:38 -04:00
xdg_decoration.c Improve CSD logic 2018-09-27 22:51:37 +10:00