[GH-ISSUE #868] Ironbar commands return 0 exit codes on IPC communication errors. #4483

Closed
opened 2026-05-23 00:53:48 +01:00 by JakeStanger · 1 comment
Owner

Originally created by @ApproachingApathy on GitHub (Feb 12, 2025).
Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/868

Describe the bug
As a workaround for #642 I tried to write a script to detect when ironbar is dead and revive it. I expected ironbar ping or ironbar reload to return a non-zero exit code when it cannot communicate with the server. However reload and ping return zero in this case. I can change the script but it might be nice to have these commands return errors.

To Reproduce
Steps to reproduce the behavior:

  1. Break the IPC server
  2. Call ironbar ping or ironbar reload
  3. The command will return a 0 exit code.

Expected behavior
IPC Communication errors should return a non-zero exitcode

System information:

  • Distro: Arch Linux
  • Ironbar version: ironbar-git 0.16.1.r81.gb296726-1

Configuration

Share your bar configuration and stylesheet as applicable:

Config

Styles

Additional context

The script original:

#!/usr/bin/env bash

COMMAND="ironbar ping"

$COMMAND;
EXIT_CODE=$?

if [[ $EXIT_CODE -ne 0 ]]; then
  killall ironbar
  uwsm app -- ironbar &
fi

What I have to do:

#!/usr/bin/env bash
OUTPUT=$(ironbar ping 2>&1)
EXIT_CODE=$?

if echo "$OUTPUT" | grep -q "Failed to connect to Ironbar IPC server"; then
  killall ironbar
  uwsm app -- ironbar &
elif [[ $EXIT_CODE -ne 0 ]]; then
  killall ironbar
  uwsm app -- ironbar &
fi

Screenshots

Image

Originally created by @ApproachingApathy on GitHub (Feb 12, 2025). Original GitHub issue: https://github.com/JakeStanger/ironbar/issues/868 **Describe the bug** As a workaround for #642 I tried to write a script to detect when ironbar is dead and revive it. I expected `ironbar ping` or `ironbar reload` to return a non-zero exit code when it cannot communicate with the server. However reload and ping return zero in this case. I can change the script but it might be nice to have these commands return errors. **To Reproduce** Steps to reproduce the behavior: 1. Break the IPC server 2. Call `ironbar ping` or `ironbar reload` 3. The command will return a 0 exit code. **Expected behavior** IPC Communication errors should return a non-zero exitcode **System information:** - Distro: Arch Linux - Ironbar version: ironbar-git 0.16.1.r81.gb296726-1 **Configuration** > Share your bar configuration and stylesheet as applicable: <details><summary>Config</summary> ``` ``` </details> <details><summary>Styles</summary> ```css ``` </details> **Additional context** The script original: ```sh #!/usr/bin/env bash COMMAND="ironbar ping" $COMMAND; EXIT_CODE=$? if [[ $EXIT_CODE -ne 0 ]]; then killall ironbar uwsm app -- ironbar & fi ``` What I have to do: ```sh #!/usr/bin/env bash OUTPUT=$(ironbar ping 2>&1) EXIT_CODE=$? if echo "$OUTPUT" | grep -q "Failed to connect to Ironbar IPC server"; then killall ironbar uwsm app -- ironbar & elif [[ $EXIT_CODE -ne 0 ]]; then killall ironbar uwsm app -- ironbar & fi ``` **Screenshots** ![Image](https://github.com/user-attachments/assets/494f7d90-444c-4a42-8e4a-50c91594283b)
JakeStanger 2026-05-23 00:53:48 +01:00
  • closed this issue
  • added the
    T:Bug
    label
Author
Owner

@JakeStanger commented on GitHub (Feb 15, 2025):

Cheers for reporting

<!-- gh-comment-id:2661143472 --> @JakeStanger commented on GitHub (Feb 15, 2025): Cheers for reporting
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
JakeStanger/ironbar#4483
No description provided.