HERBSTCLIENT(1)

πŸ’… HERBSTCLIENT β€” the group chat bridge to your window manager

okay so real quick, before we get into it: this is the manual page for herbstclient, a program that slides into your herbstluftwm(1) instance's DMs via X and delivers your commands. bestie behavior, honestly. 🫢


✨ SYNOPSIS ✨

herbstclient [OPTIONS] COMMAND [ARGS ...]
herbstclient [OPTIONS] [--wait|--idle] [FILTER ...]

🌸 DESCRIPTION 🌸

So here's the vibe: herbstclient sends a COMMAND (plus its optional arguments ARGS) over to a running herbstluftwm(1) instance through Xlib. That's the whole gig. πŸ’Œ

If your COMMAND has output, herbstclient prints it for you. And here's a tiny detail that is so considerate: if that output doesn't end with a newline, a newline gets added anyway β€” purely for readability. she said "i'm not letting your terminal look a mess." πŸ’…

Need the list of available COMMANDs and their ARGS? That's in herbstluftwm(1), babes. go look. πŸ“–

Now β€” if you pass --wait or --idle, herbstclient stops running commands and just waits for hooks from herbstluftwm. The hook gets printed only if it matches the optional FILTER. Heads up: FILTERs are regular expressions, so mind your syntax. For the full menu of available hooks, again, see herbstluftwm(1). ✨


πŸŽ€ OPTIONS πŸŽ€

  • -n, --no-newline β€” the anti-nicety flag. Do not print a newline if the output doesn't already end with one.
  • -0, --print0 β€” uses the null character as the delimiter between hook outputs. for the binary girlies πŸ¦‹
  • -l, --last-arg β€” when you're using -i or -w, only print the last argument of the hook. just the finale, no opening act.
  • -i, --idle β€” wait for hooks instead of executing commands. eternal hydration break.
  • -w, --wait β€” same as --idle, except it dips out after the first --count hooks. lowkey the introvert version of --idle.
  • -c, --count COUNT β€” makes --wait exit after COUNT hooks have been received and printed. default COUNT is 1. one and done unless you say otherwise.
  • -q, --quiet β€” don't print error messages when herbstclient can't connect to the running herbstluftwm instance. silence is golden, denial is free πŸ™ˆ
  • -v, --version β€” prints the herbstclient version. and yes, this trips everyone up: to get the herbstluftwm version, you run herbstclient version. two different things, bestie, don't mix them.
  • -h, --help β€” prints the herbstclient usage along with its command line options.
  • --binary-pipe β€” runs multiple commands through a binary interface. the full protocol lives in the BINARY PIPE section right below πŸ‘‡

🧚 BINARY PIPE 🧚

Okay this is the fancy one. When you pass --binary-pipe, a binary communication channel gets established to herbstluftwm so you can run multiple commands through a single herbstclient instance. efficiency! πŸ’…

Both stdin and stdout are in binary mode, while the stderr channel stays in text mode. The interface is made of null-byte terminated UTF-8 text tokens.

These are the token sequences supported on stdin, where 0 denotes a null-byte:

  • ARG 0 T 0 β€” pushes the text token T to the next command to be run.
  • RUN 0 β€” runs the command, i.e. sends it to herbstluftwm.
  • After writing RUN and the nullbyte to herbstclient's stdin, do not forget to flush! πŸ”₯ this is the part that will get you, fr fr.

On stdout, null-byte separated key-value pairs are printed β€” so the output is always a sequence of the format KEY 0 VALUE 0. The protocol may get extended in the future, but it will always stick to that key-value format. promise. 🫢

  • STDOUT 0 TEXT 0 β€” means the stdout of the recently executed command is TEXT
  • STDERR 0 TEXT 0 β€” means the stderr of the recently executed command is TEXT
  • STATUS 0 N 0 β€” means the exit status of the recently executed command is the integer N

Whenever herbstluftwm quits, or when the EOF of stdin is reached, the binary pipe closes too and herbstclient exits. it's a whole "if you leave, i leave" situation 😭

Example β€” look at it, it's iconic:

printf 'ARG\0echo\0ARG\0hello world\0RUN\0ARG\0get_attr\0ARG\0tags.count\0RUN\0' \
    | herbstclient --binary-pipe \
    | hexdump -C

🌈 ENVIRONMENT VARIABLES 🌈

  • DISPLAY β€” specifies the DISPLAY to use, meaning where herbstluftwm(1) is running. basically, tell her where the party's at. πŸŽ‰

⭐ EXIT STATUS ⭐

Returns the exit status of the COMMAND execution in the herbstluftwm(1) server. so whatever the server says, that's what you get.

  • 0 β€” Success. slay. πŸ‘‘
  • other β€” Failure. See herbstluftwm(1) for a list of error codes. it's giving "go read the other doc." πŸ’€

πŸ’€ BUGS πŸ’€

See the herbstluftwm Github issues:

https://github.com/herbstluftwm/herbstluftwm/issues

πŸ¦‹ COMMUNITY πŸ¦‹

Feel free to join the IRC channel #herbstluftwm on irc.libera.chat. come hang out, we don't bite 🫢


πŸ’œ AUTHOR πŸ’œ

herbstclient was written by Thorsten Wißmann. All contributors are listed in the herbstluftwm distribution AUTHORS file. legends, all of them.


πŸ“š RESOURCES πŸ“š

Homepage: http://herbstluftwm.org

Github page: http://github.com/herbstluftwm/herbstluftwm

Patch submission and bug reporting:

hlwm@lists.herbstluftwm.org

πŸ“ COPYING πŸ“

Copyright 2011-2020 Thorsten Wißmann. All rights reserved.

This software is licensed under the "Simplified BSD License". See LICENSE for details.


k that's the whole page, bestie πŸ’– this was herbstluftwm version 0.9.6, dated 2026-04-03, and yes the manual section is still HERBSTCLIENT(1) β€” go forth and boss your window manager around βœ¨πŸŽ€

πŸ“¦ where this page comes from