summaryrefslogtreecommitdiffstats
path: root/example
diff options
context:
space:
mode:
authora-kenji <aks.kenji@protonmail.com>2021-07-02 18:44:36 +0200
committera-kenji <aks.kenji@protonmail.com>2021-07-09 16:43:44 +0200
commit261e691f9f966d250c15f27969327753cf6ce59a (patch)
tree268bce5e28e7b4d654ad5bafe7784c58c914963a /example
parent2a024db839e3be60f9428d39f6e84c7e748162d0 (diff)
Add commands to layout
Add the ability to run commands on loading a layout: ``` - direction: Horizontal split_size: Percent: 50 run: command: {cmd: htop} ``` or respectively: ``` - direction: Horizontal split_size: Percent: 50 run: command: {cmd: htop, args: ["-C"]} ``` In order to specify the difference of commands and plugins now the plugins need to be under the `run` section: ``` - direction: Vertical split_size: Fixed: 2 run: plugin: status-bar ``` This also means that this is a breaking change for people that already have a custom layout. Example layouts: ``` --- direction: Vertical parts: - direction: Horizontal split_size: Percent: 50 parts: - direction: Vertical split_size: Percent: 50 - direction: Vertical split_size: Percent: 50 run: command: {cmd: htop} - direction: Horizontal split_size: Percent: 50 run: command: {cmd: htop} ``` and: ``` --- direction: Horizontal parts: - direction: Vertical split_size: Fixed: 1 run: plugin: tab-bar - direction: Vertical parts: - direction: Vertical parts: - direction: Vertical split_size: Percent: 50 run: command: {cmd: htop} - direction: Vertical split_size: Percent: 50 run: command: {cmd: htop, args: ["-C"]} - direction: Vertical split_size: Fixed: 5 - direction: Vertical split_size: Fixed: 2 run: plugin: status-bar ``` closes #551, closes #284
Diffstat (limited to 'example')
-rw-r--r--example/run_htop_layout.yaml20
-rw-r--r--example/run_htop_layout_with_plugins.yaml30
2 files changed, 50 insertions, 0 deletions
diff --git a/example/run_htop_layout.yaml b/example/run_htop_layout.yaml
new file mode 100644
index 000000000..949435d69
--- /dev/null
+++ b/example/run_htop_layout.yaml
@@ -0,0 +1,20 @@
+---
+direction: Vertical
+parts:
+ - direction: Horizontal
+ split_size:
+ Percent: 50
+ parts:
+ - direction: Vertical
+ split_size:
+ Percent: 50
+ - direction: Vertical
+ split_size:
+ Percent: 50
+ run:
+ command: {cmd: htop}
+ - direction: Horizontal
+ split_size:
+ Percent: 50
+ run:
+ command: {cmd: htop}
diff --git a/example/run_htop_layout_with_plugins.yaml b/example/run_htop_layout_with_plugins.yaml
new file mode 100644
index 000000000..99f72edbe
--- /dev/null
+++ b/example/run_htop_layout_with_plugins.yaml
@@ -0,0 +1,30 @@
+---
+direction: Horizontal
+parts:
+ - direction: Vertical
+ split_size:
+ Fixed: 1
+ run:
+ plugin: tab-bar
+ - direction: Vertical
+ parts:
+ - direction: Vertical
+ parts:
+ - direction: Vertical
+ split_size:
+ Percent: 50
+ run:
+ command: {cmd: htop}
+ - direction: Vertical
+ split_size:
+ Percent: 50
+ run:
+ command: {cmd: htop, args: ["-C"]}
+ - direction: Vertical
+ split_size:
+ Fixed: 5
+ - direction: Vertical
+ split_size:
+ Fixed: 2
+ run:
+ plugin: status-bar