swiftbar / SwiftBar

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

Naming a script with extra ‘.’ causes issues with refresh #334

Closed Joshfindit closed 2 years ago

Joshfindit commented 2 years ago

Describe the bug

I had some scripts from xbar named ping.internal.01.3s.sh, ping.internal.misc.3s.sh, ping.external.dns.3s.sh, and so-on.

When I upgraded to SwiftBar, they stopped refreshing at all.

After some puzzling, I renamed them to swap . for _ (such as ping_internal_01.3s.sh) and it works fine.

To Reproduce Steps to reproduce the behavior:

  1. Add extra .s to the filename of a script
  2. Run SwiftBar

May be complicated by the numbers at the end of the filenames

Expected behavior SwiftBar parses the .sh and the interval from the next name segment to the left, then stops parsing.

Screenshots N/A

Environment:

Plugin Example: ping v1.1 from thealmightygrant

Additional Context:

melonamin commented 2 years ago

@Joshfindit this is not a clean cut, some of the users name their scripts without file extension, like this my_plugin.30s, this is common among binary plugins users.

So it is either as it is or I should build and evristic(or just a regex) to extract the refresh interval

Joshfindit commented 2 years ago

@melonamin Sorry to hear that. I had hoped it would be a simple one but I see what you’re saying.

How about a warning in the SwiftBar menu if more than one . is detected? Personally I don’t care about renaming the files, it’s just the friction of the investigation

melonamin commented 2 years ago

Added a bit of dumb, but effective code that seems to eliminate this issue