Skip to content

Commit

Permalink
i3bar-workspace-protocol: Make examples (more) POSIX compliant (#6029)
Browse files Browse the repository at this point in the history
See https://unix.stackexchange.com/a/581410, `read` needs a variable
name.

Came up in #5939
  • Loading branch information
orestisfl committed Apr 30, 2024
1 parent e020701 commit d54a10b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/i3bar-workspace-protocol
Expand Up @@ -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;
}
------------------------------

Expand All @@ -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) ]'
------------------------------

Expand All @@ -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,
Expand All @@ -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'
------------------------------

Expand All @@ -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" ]'
------------------------------

0 comments on commit d54a10b

Please sign in to comment.