yqrashawn / GokuRakuJoudo

config karabiner with ease
GNU General Public License v3.0
1.14k stars 121 forks source link

gokuw works, but goku service seems dead #179

Closed martaver closed 2 years ago

martaver commented 2 years ago

I'm trying to debug why the goku service, which is listed as started is doing nothing on my system. When I run gokuw from a terminal session, goku works fine. However, with the service running, the changes to my edn file are not reflected in karabiner.json.

The log file is completely empty. If I delete the log file, the service recreates it when I restart the service - so I know I'm looking at the right log file.

Is there a way to get any more verbose logs out of the service and see where it's failing?

yqrashawn commented 2 years ago

Hi, this should be fixed in 0.5.4

yqrashawn commented 2 years ago

It's not fixed. Still trying to figure out why.

watchexec won't trigger the command (even the startup one) when started by launchd

image
shirshir commented 2 years ago

@yqrashawn Should the gokuw command be used in the launchd definition? https://github.com/yqrashawn/homebrew-goku/blob/2d41a49d0322b99d8f6c77657858be5ada8de028/Formula/goku.rb#L30 It's a script that already uses watchexec.

yqrashawn commented 2 years ago

@yqrashawn Should the gokuw command be used in the launchd definition? https://github.com/yqrashawn/homebrew-goku/blob/2d41a49d0322b99d8f6c77657858be5ada8de028/Formula/goku.rb#L30

It's a script that already uses watchexec.

I tried that. It won't trigger the goku command. I also tried to give watchexec full disk access, nothing changed.

shirshir commented 2 years ago

I got it working using the build in watch capabilities of launchd -> WatchPaths, so no need to use watchexec here:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>some label</string>
    <key>ProgramArguments</key>
    <array>
        <string>/usr/local/opt/goku/bin/goku</string>
    </array>
    <key>WatchPaths</key>
    <array>
        <string>/Users/username/.config/karabiner.edn</string>
    </array>
    <key>EnvironmentVariables</key>
    <dict>
        <key>GOKU_EDN_CONFIG_FILE</key>
        <string>/Users/username/.config/karabiner.edn</string>
        <key>PATH</key>
        <string>/usr/local/bin</string><!-- so goku can find joker installed by homebrew -->
    </dict>
    <key>StandardErrorPath</key>
    <string>/Users/username/Library/Logs/goku.log</string>
    <key>StandardOutPath</key>
    <string>/Users/username/Library/Logs/goku.log</string>
    <key>RunAtLoad</key>
    <true/>    
</dict>
</plist>
yqrashawn commented 2 years ago

Fixed in 0.6.0. WatchPaths works well @shirshir 🎉