matryer/xbar-plugins

Plugin can't call itself

オープン

#2,003 opened on 2023/12/14

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)Shell (1,082 件のフォーク)github user discovery
help wantedshell

Repository metrics

Stars
 (2,603 個のスター)
PR merge metrics
 (平均マージ 40d 21h) (30d で 19 merged PRs)

説明

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. :-)

コントリビューターガイド