cmacrae / spacebar

A minimal status bar for macOS. Ideal for use with tiling window managers like yabai
MIT License
1.26k stars 52 forks source link

brew services restart spacebar doesn't work #79

Closed kabirbg closed 3 years ago

kabirbg commented 3 years ago

Hi! While I can restart spacebar with launchctl kickstart -k "gui/${UID}/homebrew.mxcl.spacebar" or simply by doing brew services stop spacebar && brew services start spacebar, when I try to use brew services restart spacebar it produces the following output (without doing the restart):

[kabir:~]$ brew services restart spacebar -v
Error: undefined method `boot_path_plist_present?' for #<Homebrew::Service:0x00007fcc4fa6e988>
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/service.rb:86:in `plist_present?'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/services_cli.rb:206:in `block in restart'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/services_cli.rb:205:in `each'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/services_cli.rb:205:in `restart'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/lib/services_cli.rb:92:in `run!'
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-services/cmd/services.rb:48:in `services'
/usr/local/Homebrew/Library/Homebrew/brew.rb:122:in `<main>'

Any idea how to fix this? Like I said this issue is easily resolved by restarting using one of the other ways, but just bringing it to your attention. :)

cmacrae commented 3 years ago

Hey @kabirbg 👋 Thanks for raising this!
I don't use Homebrew, so hadn't come across this -- I'll check it out and add some testing to the package's pipeline :)

typkrft commented 3 years ago

Just in case it helps this is my output of the same command, which is successful for me. I used brew install --HEAD spacebar.

brew services restart spacebar -v
Stopping `spacebar`... (might take a while)
==> Successfully stopped `spacebar` (label: homebrew.mxcl.spacebar)
==> Generated plist for spacebar:
   <?xml version="1.0" encoding="UTF-8"?>
   <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
   <plist version="1.0">
   <dict>
     <key>Label</key>
     <string>homebrew.mxcl.spacebar</string>
     <key>ProgramArguments</key>
     <array>
       <string>/opt/homebrew/opt/spacebar/bin/spacebar</string>
     </array>
     <key>EnvironmentVariables</key>
     <dict>
       <key>PATH</key>
       <string>/opt/homebrew/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
     </dict>
     <key>RunAtLoad</key>
     <true/>
     <key>KeepAlive</key>
     <true/>
     <key>StandardOutPath</key>
     <string>/opt/homebrew/var/log/spacebar/spacebar.out.log</string>
     <key>StandardErrorPath</key>
     <string>/opt/homebrew/var/log/spacebar/spacebar.err.log</string>
   </dict>
   </plist>

/bin/launchctl enable gui/501/homebrew.mxcl.spacebar
/bin/launchctl bootstrap gui/501 /Users/USERNAME/Library/LaunchAgents/homebrew.mxcl.spacebar.plist
==> Successfully started `spacebar` (label: homebrew.mxcl.spacebar)
kabirbg commented 3 years ago

Thanks for the update! I reinstalled spacebar from HEAD and it works as it should now. I think this is probably an old issue that got fixed at some point and will be working in the next release!