Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

workspace_command process exited unexpectedly #5939

Closed
2 tasks done
qingbyin opened this issue Mar 5, 2024 · 5 comments
Closed
2 tasks done

workspace_command process exited unexpectedly #5939

qingbyin opened this issue Mar 5, 2024 · 5 comments
Labels
4.23 bug waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment.

Comments

@qingbyin
Copy link

qingbyin commented Mar 5, 2024

Welcome

  • Yes, I'm using the latest major release or the current development version. These are the only supported versions.
  • Yes, I've searched similar issues and discussions on GitHub and didn't find any.

Current Behavior

I followed i3bar workspace buttons protocol and created a workspaces.sh with the first example, then called it using workspace_command. However, It throws an error whenever I try to switch to any workspace.

Expected Behavior

Pass the test of the re-create the default behaviour of i3bar:

#!/bin/sh
i3-msg -t subscribe -m '["workspace", "output"]' | {
    # Initially print the current workspaces before we receive any events. This
    # 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;
}

Reproduction Instructions

for c in $(i3-msg -t get_bar_config | python -c \
      'import json,sys;print("\n".join(json.load(sys.stdin)))'); do \
    (i3bar --bar_id=$c >i3bar.$c.log 2>&1) & \
  done;

i3 version

Binary i3 version:  4.23 (2023-10-29) © 2009 Michael Stapelberg and contributors
Running i3 version: 4.23 (2023-10-29) (pid 2102)

Config file

bar {
  …
  workspace_command ~/.config/i3/workspaces.sh
  …
}
#!/bin/sh
i3-msg -t subscribe -m '["workspace", "output"]' | {
    # Initially print the current workspaces before we receive any events. This
    # 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;
}

Linux distribution & Version

ubuntu 20.04

Are you using a compositor?

I am sure I don't run any compositor

Logfile

.config/i3/workspaces.sh: 7: read: arg count [../i3bar/src/child.c:404] ERROR: stdin: received EOF [../i3bar/src/child.c:653] ERROR: Child (pid: 12596) unexpectedly exited with status 0
@qingbyin qingbyin added the bug label Mar 5, 2024
@i3bot i3bot added the missing-log Read the CONTRIBUTING.md file for instructions label Mar 5, 2024
@i3bot
Copy link

i3bot commented Mar 5, 2024

I don’t see a link to logs.i3wm.org. Did you follow https://i3wm.org/docs/debugging.html? (In case you actually provided a link to a logfile, please ignore me.)

@i3bot i3bot added the 4.23 label Mar 5, 2024
@orestisfl
Copy link
Member

workspace_command /path/to/your/workspaces.sh

Did you use the correct path to your script?

@qingbyin
Copy link
Author

qingbyin commented Mar 5, 2024

Yes, I did. My real bar config is :

bar {
  workspace_command ~/.config/i3/workspaces.sh
  i3bar_command i3bar --transparency
  status_command i3status-rs ~/.config/i3status-rust/config.toml
  position top
  tray_output primary
}

@orestisfl
Copy link
Member

Try changing

#!/bin/sh

to

#!/bin/bash

@orestisfl orestisfl added waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment. and removed missing-log Read the CONTRIBUTING.md file for instructions labels Apr 28, 2024
orestisfl added a commit to orestisfl/i3 that referenced this issue Apr 28, 2024
orestisfl added a commit to orestisfl/i3 that referenced this issue Apr 28, 2024
@orestisfl
Copy link
Member

Closing for now, let me know if the issue persists

@orestisfl orestisfl closed this as not planned Won't fix, can't repro, duplicate, stale May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.23 bug waiting Waiting for feedback/changes from the author of the issue/PR. Make sure to notify us with a comment.
Projects
None yet
Development

No branches or pull requests

3 participants