toml: add exec.shell
This commit is contained in:
parent
b25e7554f7
commit
325f4ea71b
4 changed files with 100 additions and 17 deletions
|
|
@ -1200,7 +1200,7 @@
|
|||
]
|
||||
},
|
||||
"Exec": {
|
||||
"description": "Describes how to execute a program.\n\n- Example 1:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = \"alacritty\" }\n ```\n\n- Example 2:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = [\"notify-send\", \"hello world\"] }\n ```\n\n- Example 3:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = { prog = \"notify-send\", args = [\"hello world\"], env.WAYLAND_DISPLAY = \"2\" } }\n ```\n",
|
||||
"description": "Describes how to execute a program.\n\n- Example 1:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = \"alacritty\" }\n ```\n\n- Example 2:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = [\"notify-send\", \"hello world\"] }\n ```\n\n- Example 3:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = { prog = \"notify-send\", args = [\"hello world\"], env.WAYLAND_DISPLAY = \"2\" } }\n ```\n\n- Example 4:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = { shell = \"grim - | wl-copy\", privileged = true } }\n ```\n",
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string",
|
||||
|
|
@ -1215,16 +1215,20 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
"description": "The name, arguments, and environment variables of the executable to execute.\n\n- Example:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = { prog = \"notify-send\", args = [\"hello world\"], env.WAYLAND_DISPLAY = \"2\" } }\n ```\n",
|
||||
"description": "The name, arguments, and environment variables of the executable to execute.\n\nExactly one of the `prog` or `shell` fields must be specified.\n\n- Example 1:\n\n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = { prog = \"notify-send\", args = [\"hello world\"], env.WAYLAND_DISPLAY = \"2\" } }\n ```\n\n- Example 2:\n \n ```toml\n [shortcuts]\n ctrl-a = { type = \"exec\", exec = { shell = \"grim - | wl-copy\", privileged = true } }\n ```\n",
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"prog": {
|
||||
"type": "string",
|
||||
"description": "The name of the executable."
|
||||
},
|
||||
"shell": {
|
||||
"type": "string",
|
||||
"description": "The name of a shell command to execute. The command will be executed as\n`$SHELL -c \"command\"`.\n"
|
||||
},
|
||||
"args": {
|
||||
"type": "array",
|
||||
"description": "The arguments to pass to the executable.",
|
||||
"description": "The arguments to pass to the executable.\n\nThis field must not be specified if a shell command is used.\n",
|
||||
"items": {
|
||||
"type": "string",
|
||||
"description": ""
|
||||
|
|
@ -1243,9 +1247,7 @@
|
|||
"description": "If `true`, the executable gets access to privileged wayland protocols.\n\nThe default is `false`.\n"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"prog"
|
||||
]
|
||||
"required": []
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2483,6 +2483,13 @@ Describes how to execute a program.
|
|||
ctrl-a = { type = "exec", exec = { prog = "notify-send", args = ["hello world"], env.WAYLAND_DISPLAY = "2" } }
|
||||
```
|
||||
|
||||
- Example 4:
|
||||
|
||||
```toml
|
||||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { shell = "grim - | wl-copy", privileged = true } }
|
||||
```
|
||||
|
||||
Values of this type should have one of the following forms:
|
||||
|
||||
#### A string
|
||||
|
|
@ -2513,24 +2520,42 @@ Each element of this array should be a string.
|
|||
|
||||
The name, arguments, and environment variables of the executable to execute.
|
||||
|
||||
- Example:
|
||||
Exactly one of the `prog` or `shell` fields must be specified.
|
||||
|
||||
- Example 1:
|
||||
|
||||
```toml
|
||||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { prog = "notify-send", args = ["hello world"], env.WAYLAND_DISPLAY = "2" } }
|
||||
```
|
||||
|
||||
- Example 2:
|
||||
|
||||
```toml
|
||||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { shell = "grim - | wl-copy", privileged = true } }
|
||||
```
|
||||
|
||||
The table has the following fields:
|
||||
|
||||
- `prog` (required):
|
||||
- `prog` (optional):
|
||||
|
||||
The name of the executable.
|
||||
|
||||
The value of this field should be a string.
|
||||
|
||||
- `shell` (optional):
|
||||
|
||||
The name of a shell command to execute. The command will be executed as
|
||||
`$SHELL -c "command"`.
|
||||
|
||||
The value of this field should be a string.
|
||||
|
||||
- `args` (optional):
|
||||
|
||||
The arguments to pass to the executable.
|
||||
|
||||
This field must not be specified if a shell command is used.
|
||||
|
||||
The value of this field should be an array of strings.
|
||||
|
||||
|
|
|
|||
|
|
@ -733,6 +733,13 @@ Exec:
|
|||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { prog = "notify-send", args = ["hello world"], env.WAYLAND_DISPLAY = "2" } }
|
||||
```
|
||||
|
||||
- Example 4:
|
||||
|
||||
```toml
|
||||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { shell = "grim - | wl-copy", privileged = true } }
|
||||
```
|
||||
kind: variable
|
||||
variants:
|
||||
- kind: string
|
||||
|
|
@ -760,24 +767,42 @@ Exec:
|
|||
- kind: table
|
||||
description: |
|
||||
The name, arguments, and environment variables of the executable to execute.
|
||||
|
||||
Exactly one of the `prog` or `shell` fields must be specified.
|
||||
|
||||
- Example:
|
||||
- Example 1:
|
||||
|
||||
```toml
|
||||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { prog = "notify-send", args = ["hello world"], env.WAYLAND_DISPLAY = "2" } }
|
||||
```
|
||||
|
||||
- Example 2:
|
||||
|
||||
```toml
|
||||
[shortcuts]
|
||||
ctrl-a = { type = "exec", exec = { shell = "grim - | wl-copy", privileged = true } }
|
||||
```
|
||||
fields:
|
||||
prog:
|
||||
kind: string
|
||||
required: true
|
||||
required: false
|
||||
description: The name of the executable.
|
||||
shell:
|
||||
kind: string
|
||||
required: false
|
||||
description: |
|
||||
The name of a shell command to execute. The command will be executed as
|
||||
`$SHELL -c "command"`.
|
||||
args:
|
||||
kind: array
|
||||
required: false
|
||||
items:
|
||||
kind: string
|
||||
description: The arguments to pass to the executable.
|
||||
description: |
|
||||
The arguments to pass to the executable.
|
||||
|
||||
This field must not be specified if a shell command is used.
|
||||
env:
|
||||
kind: map
|
||||
required: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue