diff options
author | Orestis Floros <orestisflo@gmail.com> | 2024-04-30 13:41:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-30 13:41:45 +0200 |
commit | d54a10b200e6e14b36c0fb618525c2cfe434e4fa (patch) | |
tree | a505cf196f91839c235496ab97469af5fb532450 /docs | |
parent | e020701df1cca986f64ab7b9d15d6d30a95c1418 (diff) | |
download | i3-d54a10b200e6e14b36c0fb618525c2cfe434e4fa.tar.gz i3-d54a10b200e6e14b36c0fb618525c2cfe434e4fa.zip |
i3bar-workspace-protocol: Make examples (more) POSIX compliant (#6029)
See https://unix.stackexchange.com/a/581410, `read` needs a variable
name.
Came up in #5939
Diffstat (limited to 'docs')
-rw-r--r-- | docs/i3bar-workspace-protocol | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/i3bar-workspace-protocol b/docs/i3bar-workspace-protocol index 02db0ed0..009b2a1d 100644 --- a/docs/i3bar-workspace-protocol +++ b/docs/i3bar-workspace-protocol @@ -129,7 +129,7 @@ i3-msg -t subscribe -m '["workspace", "output"]' | { # avoids having an empty bar when starting up. i3-msg -t get_workspaces; # Then, while we receive events, update the workspace information. - while read; do i3-msg -t get_workspaces; done; + while read EVENT; do i3-msg -t get_workspaces; done; } ------------------------------ @@ -139,7 +139,7 @@ i3-msg -t subscribe -m '["workspace", "output"]' | { #!/bin/sh i3-msg -t subscribe -m '["workspace", "output"]' | { i3-msg -t get_workspaces; - while read; do i3-msg -t get_workspaces; done; + while read EVENT; do i3-msg -t get_workspaces; done; } | jq --unbuffered -c '[ .[] | select(.name != "foo" or .focused) ]' ------------------------------ @@ -153,7 +153,7 @@ might mean that you are getting an empty bar until enough events are written. #!/bin/sh i3-msg -t subscribe -m '["workspace", "output"]' | { i3-msg -t get_workspaces; - while read; do i3-msg -t get_workspaces; done; + while read EVENT; do i3-msg -t get_workspaces; done; } | jq --unbuffered -c ' def fake_ws(name): { name: name, @@ -169,7 +169,7 @@ i3-msg -t subscribe -m '["workspace", "output"]' | { #!/bin/sh i3-msg -t subscribe -m '["workspace", "output"]' | { i3-msg -t get_workspaces; - while read; do i3-msg -t get_workspaces; done; + while read EVENT; do i3-msg -t get_workspaces; done; } | jq --unbuffered -c 'sort_by(.name) | reverse' ------------------------------ @@ -179,6 +179,6 @@ i3-msg -t subscribe -m '["workspace", "output"]' | { #!/bin/sh i3-msg -t subscribe -m '["workspace", "output"]' | { i3-msg -t get_workspaces; - while read; do i3-msg -t get_workspaces; done; + while read EVENT; do i3-msg -t get_workspaces; done; } | jq --unbuffered -c '[ .[] | .name |= . + " foo" ]' ------------------------------ |