FelixKratz / SketchyBar

A highly customizable macOS status bar replacement
https://felixkratz.github.io/SketchyBar/
GNU General Public License v3.0
5.45k stars 85 forks source link

click_script does not respond with brew services #378

Closed EmperorEntropy closed 1 year ago

EmperorEntropy commented 1 year ago

I have recently been using sketchybar as a new user, and it is an awesome program! However, I have ran into an issue regarding click_script that I couldn't resolve. When sketchybar is started by brew services with the brew services start sketchybar command, my click_script doesn't work for my custom item, and clicking on it doesn't do anything. Below is what I have in my config:

sketchybar --add item clock right                              \
           --set clock   update_freq=10                        \
                         icon=                                \
                         script="$PLUGIN_DIR/clock.sh"         \
                                                               \
           --add item wifi right                               \
           --set wifi    script="$PLUGIN_DIR/wifi.sh"          \
                         icon=直                               \
           --subscribe wifi wifi_change                        \
                                                               \
           --add item volume right                             \
           --set volume  script="$PLUGIN_DIR/volume.sh"        \
           --subscribe volume volume_change                    \
                                                               \
           --add item switcher right                           \
           --set switcher    icon=󰸉                            \
                             click_script="cd '/Users/entropy/Documents/Backup/Scripts/Script Launcher';
                                           Python3 script_launcher.py" \

I confirmed that the click_script works when I run sketchybar, but it fails to respond when sketchybar is ran using brew services. I doubled check that sketchybarc had permission to access the Documents folder, but I still couldn't resolve the problem. Please take a look at this issue, and thank you for reading about it!

FelixKratz commented 1 year ago

You can see the log files sketchybar produces when running as a service here: /opt/homebrew/var/log/sketchybar or /usr/local/var/log/sketchybar they might contain the relevant information what is going wrong at the bottom of either the sketchybar.err.log file or the sketchybar.out.log file.

EmperorEntropy commented 1 year ago

Thank you so much! With the error log, I was able to figure out the issue and resolve it! I had multiple versions of Python installed, and it turned out brew services was using a different one, which caused issues with the code I wrote. Thanks again!