SwiftBar icon indicating copy to clipboard operation
SwiftBar copied to clipboard

Swiftbar does not show up in menubar

Open gkrawiec opened this issue 8 months ago • 17 comments

Describe the bug I installed swiftbar. Upon installation, i can see it in the menucar and I select the plugin folder. After that it disappears. I can only quit it using activity monitor. If I launch a second time, it flashes for a second on the menu bar and then disappears again. It is running according to activity monitor

To Reproduce install and launch.

Environment:

  • macOS version: 15.4.1
  • SwiftBar version: latest (cant tell what is installed since I cannot open it)

Additional Context: Interestingly the exact same behavior with xBar.

gkrawiec avatar Apr 25 '25 15:04 gkrawiec

Show me the output of com.ameba.SwiftBar

melonamin avatar Apr 25 '25 19:04 melonamin

I had the same error but my environment is macOS version: 15.2 This is my output of launchctl list | grep com.ameba.SwiftBar 55280 0 application.com.ameba.SwiftBar.21427290.21427303

This is my output of launchctl list application.com.ameba.SwiftBar.21427290.21427303

{
	"LimitLoadToSessionType" = "Aqua";
	"_AdditionalProperties" = {
		"RunningBoard" = {
			"TMPDIR" = "/var/folders/mx/6737bzg576s_y5y0y341xypw0000gp/T/";
			"BeforeTranslocationBundlePath" = "/Users/myusername/Downloads/SwiftBar.app";
			"HOME" = "/Users/myusername";
			"RunningBoardLaunchedIdentity" = {
				"AJL" = "application.com.ameba.SwiftBar.21427290.21427303";
				"TYPE" = 1;
				"EAI" = "com.ameba.SwiftBar";
				"AUID" = 				"PLAT" = 			};
			"RunningBoardLaunched" = true;
		};
	};
	"Label" = "application.com.ameba.SwiftBar.21427290.21427303";
	"OnDemand" = true;
	"LastExitStatus" = 0;
	"PID" = 55280;
	"Program" = "/private/var/folders/mx/6737bzg576s_y5y0y341xypw0000gp/T/AppTranslocation/03365236-0A64-4534-B01E-464636AAE688/d/SwiftBar.app/Contents/MacOS/SwiftBar";
	"ProgramArguments" = (
		"/private/var/folders/mx/6737bzg576s_y5y0y341xypw0000gp/T/AppTranslocation/03365236-0A64-4534-B01E-464636AAE688/d/SwiftBar.app/Contents/MacOS/SwiftBar";
	);
	"PerJobMachServices" = {
		"com.apple.tsm.portname" = mach-port-object;
		"com.apple.coredrag" = mach-port-object;
		"com.apple.axserver" = mach-port-object;
	};
};

This is the result of ps -p 55280 -o pid,etime,comm,args

  PID ELAPSED   COMM                ARGS
55280   18:56   /private/var/fol   /private/var/folders/mx/6737bzg576s_y5y0y341xypw0000gp/T/AppTran

This is the result of top -pid 55280

PID    COMMAND      %CPU TIME     #TH  #WQ  #POR MEM  PURG CMPR PGRP  PPID STATE    BOOSTS     %CPU_ME %CPU_OTHRS UID  FAUL COW  MSGS MSGR SYSB SYSM CSW  PAGE IDLE POWE INST CYCL JETP USER   #MRE RPRV VPRV VSIZ
55280  SwiftBar     0.0  00:00.18 3    1    178  16M  0B   11M  55280 1    sleeping *0[38]     0.00000 0.00000    502  7558 402  1822 494  4088 4453 1767 149  1    0.0  0    0    100  myusn N/A  N/A  N/A  N/A

cheesecakelvr avatar Apr 27 '25 18:04 cheesecakelvr

For me, when I delee everything in /Users/USER/Library/Application Support/SwiftBar/Plugins I get the SwiftBar menu back. Even with a simple echo "This is Menu Title" plugin foo.1m.sh the menu disappears and nothing in console?

Could https://github.com/swiftbar/SwiftBar/discussions/189 be related?

jussikuosa avatar Jun 13 '25 20:06 jussikuosa

Ok, I finally have time to look into it. @jussikuosa can you give me the output of defaults read com.ameba.SwiftBar please?

melonamin avatar Jul 16 '25 23:07 melonamin

This is happening to me as well.

@melonamin here's the outputs

❯ defaults read com.ameba.SwiftBar
{
    NSNavPanelExpandedSizeForOpenMode = "{800, 448}";
    NSOSPLastRootDirectory = {length = 780, bytes = 0x626f6f6b 0c030000 00000410 30000000 ... ac010000 00000000 };
    "NSWindow Frame NSNavPanelAutosaveName" = "476 465 800 448 0 0 1710 1068 ";
    PluginDirectory = "/Users/tim/scripts/swiftbar";
    SUHasLaunchedBefore = 1;
}

timcappalli avatar Jul 30 '25 13:07 timcappalli

I'm having the same issue with SwiftBar. The app seems to be running in the background—my scripts are executing perfectly and the logs confirm it—but the icon and the output just don't appear in my menubar. It's like it's invisible.

I reset the settings with defaults delete com.ameba.SwiftBar and then re-selected my plugins folder.

The Console logs show the script is running with "Successfully executed script," but they also say "running-active-NotVisible."

I also noticed the app is quarantined (com.apple.quarantine). When I tried to remove the quarantine flag with xattr -d, I got a "Permission denied" error. Here is the output of defaults read com.ameba.SwiftBar it says visible item 0.

{
    MakePluginExecutable = 1;
    NSNavPanelExpandedSizeForOpenMode = "{800, 448}";
    NSOSPLastRootDirectory = {length = 752, bytes = 0x626f6f6b f0020000 00000410 30000000 ... 90010000 00000000 };
    "NSStatusItem Visible Item-0" = 0;
    "NSWindow Frame NSNavPanelAutosaveName" = "356 372 800 448 0 0 1512 944 ";
    PluginDirectory = "/Users/alpbora/SwiftBarPlugins";
    SUHasLaunchedBefore = 1;
}

I am using Sequoia 15.5 and swiftbar v2.0.1

AlpBora avatar Aug 10 '25 12:08 AlpBora

Are any of you running SwiftBar from Downloads folder by any chance?

I still can't reproduce this, but have a new build for you to try

SwiftBar 539.zip

melonamin avatar Aug 10 '25 12:08 melonamin

I did not run from Downloads just droped it to applications from downloads. Tried this build but nothing changed.

AlpBora avatar Aug 10 '25 15:08 AlpBora

Are any of you running SwiftBar from Downloads folder by any chance?

Copied to /Applications

I still can't reproduce this, but have a new build for you to try

SwiftBar 539.zip

No change for me.

timcappalli avatar Aug 10 '25 16:08 timcappalli

defaults read com.ameba.SwiftBar

Sorry @melonamin, just came back from vacation. I'm not sure what I did, but I got the menu to show after I tweaked "something" in the plugins. Initially, I was running the plugins from a symlinked folder. I then changed them to my $HOME and got the plugin to work, but now I have the full original path as the plugin folder and it still works.

Even with a simple echo "This is Menu Title" plugin foo.1m.sh the menu disappears and nothing in console?

Others, do you have an issue even with a simple plugin?

jussikuosa avatar Aug 11 '25 06:08 jussikuosa

I also noticed the app is quarantined (com.apple.quarantine). When I tried to remove the quarantine flag with xattr -d, I got a "Permission denied" error. Here is the output of defaults read com.ameba.SwiftBar it says visible item 0.

Use sudo xattr -r -d com.apple.quarantine /Applications/SwiftBar.app (notice the -r flag). It works for me with SwiftBar.v2.0.1.b536.zip installed via brew and a single file plugin test.1m.sh with contents #!/bin/bash echo "Test" (set executable) on mac os 15.5.

Clindbergh avatar Sep 03 '25 10:09 Clindbergh

I have the same issue, whenever I add a new file into the empty plugin folder, SwiftBar will disappear from menu bar, and when I delete that new file, SwiftBar will re-appear. I tried to change plugin folder to another folder, but when I change it back to the original folder (which has one script) then SwiftBar will disappear again. It looks like SwiftBar is shy when seeing files in plugin folder?

tha2015 avatar Sep 20 '25 13:09 tha2015

This is what I found: whenever I creating a file in my plugins folder, my vscode editor creates an empty file first (before I have a chance to input the content). And because SwiftBar monitors my plugins folder to sync to its folder ( in $HOME/Library/Application Support/SwiftBar/Plugins ) , when it finds the empty file, it will create a directory with the same name in its folder "~/Library/Application Support/SwiftBar/Plugins/" (but this is a wrong behavior). This folder somehow impacts to normal SwiftBar operations and won't show anything in the menubar.

My workaround:

  • kill swiftbar process
  • delete everything in "~/Library/Application Support/SwiftBar/Plugins" (especially folders)
  • create my plugin script with full content, add executable permission
  • (IMPORATNT) copy the file to swiftbar folder at "~/Library/Application Support/SwiftBar/Plugins"
  • start swiftbar again
  • Double check to make sure that there is no folder being created by SwiftBar in "~/Library/Application Support/SwiftBar/Plugins"

tha2015 avatar Sep 20 '25 14:09 tha2015

I think something is broken with SwiftBar logic when it sync'ing files from user plugins folder to its internal plugin folder ~/Library/Application Support/SwiftBar/Plugins (it keeps creating folders instead of files).

tha2015 avatar Sep 20 '25 14:09 tha2015

I have the same issue, whenever I add a new file into the empty plugin folder, SwiftBar will disappear from menu bar, and when I delete that new file, SwiftBar will re-appear. I tried to change plugin folder to another folder, but when I change it back to the original folder (which has one script) then SwiftBar will disappear again. It looks like SwiftBar is shy when seeing files in plugin folder?

I just encountered a similar issue. Swiftbar started but there was no menu item. I had three executable files in the folder: gitea-ci-dev.5s.sh, gitea-ci-lib.sh, gitea-ci-master.5s.sh. The lib file is not a Switbar script, but used by the other two. When I remove the lib script, then start Swiftbar, the menu items appear (but with an error since the lib script is missing). Now I can move the script back into the folder and the script work again.

Clindbergh avatar Oct 20 '25 14:10 Clindbergh

This might be related, but whenever Swiftbar seems to crash, it sets the menubar setting in Tahoe to not display the app, so when the app is relaunched, it doesn't appear, even though it is running.

theboyler avatar Nov 09 '25 13:11 theboyler