matryer / matryer/xbar-plugins

Plugin can't call itself

Open
#2,003 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted shell
Dominant language
Shell
Stars
2.6k
Forks
1.1k
Avg merge
9d 15h
Merged PRs (30d)
1

Description

Hi,
I have been using xbar for a while to easily connect/disconnect from a VPN.
Lately, the script stopped functioning.
I'm on macOS 13.6.2.

The following dummy plugin reproduces the problem; it is supposed to toggle a variable but does not work:

```
#!/usr/bin/env bash
STATUS=NA

case "$1" in
on)
STATUS=1
;;
off)
STATUS=0
;;
esac

if [ "$STATUS" == "1" ]; then
echo "Status: $STATUS"
echo '---'
echo "Turn off | bash='$0' param1=off terminal=false refresh=true"
exit
else
echo "Status: $STATUS"
echo '---'
echo "Turn on | bash='$0' param1=on terminal=false refresh=true"
exit
fi
```
The issue seems to be that the plugin fails to call itself for action (bash=$0).

Any help on how to solve this would be appreciated. :-)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided Bash plugin on macOS 13.6.2 and compare the self-call action using bash='$0' with a known working xbar plugin. Trace how xbar handles bash actions and refresh parameters; done means the plugin can toggle between on and off and refresh its displayed status.

Written by the indexing model from the issue text.

Assessment

Tech stack
shell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.