Skip to content

Commit 88d0100

Browse files
committed
Better error message if calling yabai failed
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. ```
1 parent 2aa0bd9 commit 88d0100

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

stackline/query.lua

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,19 @@ local function yabai(command, callback) -- {{{
55
callback = callback or function(x) return x end
66
command = '-m ' .. command
77

8-
hs.task.new(
9-
stackline.config:get'paths.yabai',
10-
u.task_cb(callback), -- wrap callback in json decoder
11-
command:split(' ')
8+
local task = hs.task.new(
9+
stackline.config:get 'paths.yabai',
10+
u.task_cb(callback), -- wrap callback in json decoder
11+
command:split(' ')
1212
):start()
13-
end -- }}}
13+
if not task then
14+
log.e(
15+
"Error calling '" ..
16+
stackline.config:get('paths.yabai') ..
17+
" " .. command .. "'. " .. "Please check logs above this message to find out what went wrong."
18+
)
19+
end
20+
end -- }}}
1421

1522
local function stackIdMapper(yabaiWindow) -- {{{
1623
-- u.p(yabaiWindow)

0 commit comments

Comments
 (0)