Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add service managment into sketchybar like yabai #541

Closed
k2662 opened this issue Apr 21, 2024 · 1 comment
Closed

add service managment into sketchybar like yabai #541

k2662 opened this issue Apr 21, 2024 · 1 comment

Comments

@k2662
Copy link

k2662 commented Apr 21, 2024

It would be nice to have sketchybar manage itself instead of buggy brew.

@FelixKratz
Copy link
Owner

It is true that brew is a bit buggy and there are so many bug reports just because of strangeness in brew, however it seems to work great most of the times. It is very simple to work directly with the launchctl cli to manage the service completely without relying on brew or sketchybar:

  1. Compile the sketchybar program from source and copy it to /usr/local/bin/sketchybar
  2. Create a git.felix.sketchybar.plist file in ~/Library/LaunchAgents/
<?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>git.felix.sketchybar</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/bin/sketchybar</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
        <key>PATH</key>
        <string>/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/homebrew/bin:/opt/homebrew/sbin</string>
    </dict>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <true/>
    <key>StandardOutPath</key>
    <string>/tmp/sketchybar.out.log</string>
    <key>StandardErrorPath</key>
    <string>/tmp/sketchybar.err.log</string>
    <key>ThrottleInterval</key>
    <integer>30</integer>
    <key>ProcessType</key>
    <string>Interactive</string>
    <key>Nice</key>
    <integer>-20</integer>
</dict>
</plist>
  1. Bootstrap the plist with
launchctl bootstrap gui/$UID $HOME/Library/LaunchAgents/git.felix.sketchybar.plist
launchctl load -w $HOME/Library/LaunchAgents/git.felix.sketchybar.plist

@FelixKratz FelixKratz closed this as not planned Won't fix, can't repro, duplicate, stale Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants