Skip to content

socket message format different to format specified in man pages and stdin format #51

@samjjacko

Description

@samjjacko

I'm starting dwlb through a couple of scripts:

# launch script ran by .zprofile on login
#...
rm -f "XDG_RUNTIME_DIR/dwlb/dwlb-0"
exec dbus-run-session -- dwl -s ~/.config/dwl/autostart.sh >> ~/zlog 2>&1
#autostart.sh
# ...
dwlb -target-socket "$XDG_RUNTIME_DIR/dwlb/dwlb-0" -ipc &

And I'm attempting to update the status with the following script:

# ...
echo "-status all $STATUS" | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/dwlb/dwlb-0

following the same format in the readme:

dwlb -status all 'text ^bg(ff0000)^lm(foot)text^bg()^lm() text'

and following the same format specified in the help text:

"-status [OUTPUT] [TEXT]"

but this doesn't appear to work.

I think in read_socket(), the [OUTPUT] is checked first:
https://github.com/kolunmi/dwlb/blob/48dbe00bdb98a1ae6a0e60558ce14503616aa759/dwlb.c#L1469C1-L1485C3

after doing some debugging, it seems that the format [output] [argument] [text] is accepted instead -

echo "all status $STATUS" | socat - UNIX-CONNECT:$XDG_RUNTIME_DIR/dwlb/dwlb-0

functions as intended.

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