Skip to content

Commit

Permalink
Better error message if calling yabai failed
Browse files Browse the repository at this point in the history
Used to just print:
```
** Warning:   LuaSkin: hs.task:launch() Unable to launch hs.task process: launch path not accessible
```

Now it prints the full command it was trying to run:

```
query: Error calling '/usr/local/bin/yabai -m query --windows'. Please check logs above this message to find out what went wrong.
```
  • Loading branch information
alexpopov committed Jul 24, 2023
1 parent 2aa0bd9 commit 88d0100
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions stackline/query.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,19 @@ local function yabai(command, callback) -- {{{
callback = callback or function(x) return x end
command = '-m ' .. command

hs.task.new(
stackline.config:get'paths.yabai',
u.task_cb(callback), -- wrap callback in json decoder
command:split(' ')
local task = hs.task.new(
stackline.config:get 'paths.yabai',
u.task_cb(callback), -- wrap callback in json decoder
command:split(' ')
):start()
end -- }}}
if not task then
log.e(
"Error calling '" ..
stackline.config:get('paths.yabai') ..
" " .. command .. "'. " .. "Please check logs above this message to find out what went wrong."
)
end
end -- }}}

local function stackIdMapper(yabaiWindow) -- {{{
-- u.p(yabaiWindow)
Expand Down

0 comments on commit 88d0100

Please sign in to comment.