swiftbar / SwiftBar

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

Stopped after installing a weather plugin #400

Open orasik opened 10 months ago

orasik commented 10 months ago

Describe the bug When I install the weather plugin wttr.in, the app disappears from the menu.

image

To Reproduce Steps to reproduce the behavior:

  1. Install SwiftBar.
  2. Run SwiftBar.
  3. Install the wittr.in plugin
  4. Wait for a few seconds.
  5. You will get greyed out results (see screenshot), then the menu icon disappears and I cannot run SwiftBar again.

Screenshots image

Environment:

Plugin Example: https://github.com/matryer/xbar-plugins/blob/master/Weather/wttr-in.15m.sh

melonamin commented 10 months ago

This plugin uses plugin parameters feature from xbar, that is unsuported in SwiftBar.

# Variables:
# <xbar.var>string(VAR_LOCATION="Cupertino"): Your location.</xbar.var>
# <xbar.var>string(VAR_FORMAT="3"): Display format. Ref: https://github.com/chubin/wttr.in#one-line-output</xbar.var>

curl "wttr.in/${VAR_LOCATION}?format=${VAR_FORMAT}"

It is an easy fix, replace curl "wttr.in/${VAR_LOCATION}?format=${VAR_FORMAT}" with curl "wttr.in/?format=3" and it will work as expected.

orasik commented 10 months ago

@melonamin I tried that, but still the app didn't work after until I removed the plugin folder.

melonamin commented 10 months ago

Weird. If you face this problem again, can you please share SwiftBar logs from Console.app?

orasik commented 10 months ago

Sure, here it is

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Process:               SwiftBar [51271]
Path:                  /Applications/SwiftBar.app/Contents/MacOS/SwiftBar
Identifier:            com.ameba.SwiftBar
Version:               2.0.0 (520)
Code Type:             ARM-64 (Native)
Parent Process:        launchd [1]
User ID:               501

Date/Time:             2024-01-02 20:01:36.6270 +0000
OS Version:            macOS 14.2.1 (23C71)
Report Version:        12
Anonymous UUID:        9BD6A471-4C97-550A-B16B-4D68C96C9EB5

Sleep/Wake UUID:       1BA24220-4542-4131-8E75-224DCFA768D2

Time Awake Since Boot: 390000 seconds
Time Since Wake:       3272 seconds

System Integrity Protection: enabled

Crashed Thread:        0  Dispatch queue: com.apple.main-thread

Exception Type:        EXC_BREAKPOINT (SIGTRAP)
Exception Codes:       0x0000000000000001, 0x00000001995f6040

Termination Reason:    Namespace SIGNAL, Code 5 Trace/BPT trap: 5
Terminating Process:   exc handler [51271]

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libswiftDispatch.dylib                 0x1995f6040 static OS_dispatch_source.makeProcessSource(identifier:eventMask:queue:) + 28
1   SwiftBar                               0x1005b84b4 0x100544000 + 476340
2   SwiftBar                               0x1005919ec 0x100544000 + 317932
3   SwiftBar                               0x10058e90c 0x100544000 + 305420
4   SwiftBar                               0x100591c8c 0x100544000 + 318604
5   SwiftBar                               0x100591f94 0x100544000 + 319380
6   SwiftBar                               0x1005dbe88 0x100544000 + 622216
7   libdispatch.dylib                      0x183f4ecb8 _dispatch_call_block_and_release + 32
8   libdispatch.dylib                      0x183f50910 _dispatch_client_callout + 20
9   libdispatch.dylib                      0x183f5efa8 _dispatch_main_queue_drain + 984
10  libdispatch.dylib                      0x183f5ebc0 _dispatch_main_queue_callback_4CF + 44
11  CoreFoundation                         0x184220ecc __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
12  CoreFoundation                         0x1841de7d0 __CFRunLoopRun + 1996
13  CoreFoundation                         0x1841dd9ac CFRunLoopRunSpecific + 608
14  HIToolbox                              0x18e78c448 RunCurrentEventLoopInMode + 292
15  HIToolbox                              0x18e78c284 ReceiveNextEventCommon + 648
16  HIToolbox                              0x18e78bfdc _BlockUntilNextEventMatchingListInModeWithFilter + 76
17  AppKit                                 0x1879ba8a4 _DPSNextEvent + 660
18  AppKit                                 0x188194980 -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 716
19  AppKit                                 0x1879add50 -[NSApplication run] + 476
20  AppKit                                 0x187985014 NSApplicationMain + 880
21  SwiftBar                               0x100546954 0x100544000 + 10580
22  dyld                                   0x183d810e0 start + 2360