swiftbar / SwiftBar

Powerful macOS menu bar customization tool
https://swiftbar.app
MIT License
2.93k stars 92 forks source link

Shell scripts open terminal window on macOS Monterey #243

Closed tthkbw closed 2 years ago

tthkbw commented 2 years ago

I have a plugin that provide menu items to disable and enable ad blocking using pihole. These entries just run shell scripts:

#!/usr/bin/env bash

pihole_state=$(/Users/xxx/bin/check_adblock.sh)

echo $pihole_state

echo "---"
echo "Disable Adblock | shell='/Users/xxx/bin/noadblock.sh'"
echo "Enable Adblock | shell='/Users/xxx/bin/adblock.sh'"
echo "Pi Stats:"
cat /Users/xxx/bin/PiholeStats.txt

Since updating to macOS Monterey, if I select "Disable Adblock" or "Enable Adblock" the scripts run properly, but in doing so, they open terminal windows. Before the upgrade to Monterey these scripts ran without opening a terminal window.

Can I get that functionality back somehow?

melonamin commented 2 years ago

Hi there,

I'm not sure how Monterey could effect this, but here is a sample that works correctly both on Monterey and Big Sur

#!/bin/bash

echo ":cloud:"
echo "---"
echo "Beep | shell='say' param1='beep' terminal=false" # just beeps
echo "Beep in terminal | shell='say' param1='beep'" # opens terminal and beeps

As you can see terminal defaults to true

tthkbw commented 2 years ago

Well, that fixes it! I'm not sure why I didn't see this under Big Sur, but I'm sure I didn't.

Thanks.