FelixKratz / SketchyBar

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

env: lua: No such file or directory #606

Closed crates51 closed 1 month ago

crates51 commented 3 months ago

So i've switched recently to aerospace from yabai and i set inside aerospace to launch sketchybar at startup:

after-startup-command = [
    'exec-and-forget /usr/local/bin/sketchybar > ~/logs/sketchybar.log 2>&1',
]

Sketchybar theoretically gets launched since i can see it inside htop processes but it doesn't appear. As you can see above, i logged the output, and i get:

cat ~/logs/sketchybar.log
env: lua: No such file or directory

the configs i have for Sketchybar are the ones i think you posted inside a github page for sharing configs; its a lua one.

I searched online for this error, and the only idea came to mind is to set LUA_PATH, so i did that:

echo $LUA_PATH
/usr/local/bin/lua

Any clues why sketchybar cannot detect Lua at startup?

image

AmmarCodes commented 2 months ago

Try adding these to your aerospace config (adjust if needed):

# See https://nikitabobko.github.io/AeroSpace/guide#exec-env-vars
[exec]                   # Again, you don't need to copy all config sections to your config.
inherit-env-vars = true  # If you don't touch "exec" section,
[exec.env-vars]          # it will fallback to "default-config.toml"
PATH = '/opt/homebrew/bin:/opt/homebrew/sbin:${PATH}'
zobi commented 1 month ago

just install lua : brew install lua

crates51 commented 1 month ago

Thanks all for the help !

I fixed it by:

  1. Finding my lua path using where is lua (for me it ended up being /usr/local/bin
  2. Adding the path to aerospace config
    [exec.env-vars]        
    PATH = '/usr/local/bin:${PATH}'
  3. Restarting the sketchybar at aerospace startup: (i don't know why is this neccesary but i get another wierd error like "Could not acquire lockfile..")
after-startup-command = [
    'exec-and-forget  brew services restart sketchybar',
]