Skip to content

command using jq works when running from command line but not as a service #348

@amuricys

Description

@amuricys

skhd-v0.3.9
yabai-v7.1.0

command in question

# create desktop, move window and follow focus - uses jq for parsing json
lshift + lcmd - n : yabai -m space --create && \
        index="$(yabai -m query --spaces --display | ~/.nix-profile/bin/jq 'map(select(."is-native-fullscreen" == false))[-1].index')" && \
        yabai -m window --space "${index}" && \
        yabai -m space --focus "${index}"

if I run skhd from a terminal, this command works correctly. but if I run skhd --start-service, it simply does not. I don't know where to look for logs either.

Note that if I comment out the index variable and set a literal index, like so:

lshift + lcmd - n : yabai -m space --create && \
        yabai -m window --space "5" && \
        yabai -m space --focus "5"

it works (assuming i only have 4 spaces)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions