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-ior-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--counthooks. lowkey the introvert version of--idle.-c,--countCOUNTβ makes--waitexit afterCOUNThooks have been received and printed. defaultCOUNTis1. one and done unless you say otherwise.-q,--quietβ don't print error messages whenherbstclientcan't connect to the runningherbstluftwminstance. silence is golden, denial is free π-v,--versionβ prints theherbstclientversion. and yes, this trips everyone up: to get theherbstluftwmversion, you runherbstclient version. two different things, bestie, don't mix them.-h,--helpβ prints theherbstclientusage 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:
ARG0T0β pushes the text tokenTto the next command to be run.RUN0β runs the command, i.e. sends it toherbstluftwm.- After writing
RUNand the nullbyte toherbstclient'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. π«Ά
STDOUT0TEXT0β means the stdout of the recently executed command isTEXTSTDERR0TEXT0β means the stderr of the recently executed command isTEXTSTATUS0N0β means the exit status of the recently executed command is the integerN
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 theDISPLAYto use, meaning whereherbstluftwm(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. Seeherbstluftwm(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
- arch rolling: herbstluftwm 0.9.6-1 Β· BSD-2-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms