XSetWMIconName(3)
π XSetWMIconName(3) β icon name vibes, but make it Xlib
okay so bestie, welcome to this XLIB FUNCTIONS page. The manual name is XSetWMIconName(3) β and yes, it also covers its besties. Weβre setting and reading a windowβs WM_ICON_NAME property, and honestly itβs giving tiny-label, big-main-character energy. π
β¨ NAME β¨
XSetWMIconName, XGetWMIconName, XSetIconName, XGetIconName β set or read a windowβs WM_ICON_NAME property. Thatβs the whole assignment, bestie. π«Ά
π§ SYNTAX π§
Here are the signatures, verbatim β line wraps and all:
void XSetWMIconName(Display *display, Window w, XTextProperty
*text_prop);
Status XGetWMIconName(Display *display, Window w, XTextProperty
*text_prop_return);
int XSetIconName(Display *display, Window w, _Xconst char *icon_name);
Status XGetIconName(Display *display, Window w, char
**icon_name_return);
πΈ ARGUMENTS πΈ
displayβ specifies the connection to the X server. lowkey the group chat with the server.icon_nameβ specifies the icon name, which should be a null-terminated string. yes, null-terminated, donβt forget.icon_name_returnβ returns the windowβs icon name, which is a null-terminated string. itβs where the answer comes back to you.text_propβ specifies theXTextPropertystructure to be used.text_prop_returnβ returns theXTextPropertystructure.wβ specifies the window. the actual window in question, periodt.
π DESCRIPTION π
The XSetWMIconName convenience function calls XSetTextProperty to set the WM_ICON_NAME property. easy peasy.
The XGetWMIconName convenience function calls XGetTextProperty to obtain the WM_ICON_NAME property. It returns a nonzero status on success; otherwise, it returns a zero status. slay.
The XSetIconName function sets the name to be displayed in a windowβs icon.
XSetIconName can generate BadAlloc and BadWindow errors.
The XGetIconName function returns the name to be displayed in the specified windowβs icon. If it succeeds, it returns a nonzero status; otherwise, if no icon name has been set for the window, it returns zero.
If you never assigned a name to the window, XGetIconName sets icon_name_return to NULL. If the data returned by the server is in the Latin Portable Character Encoding, then the returned string is in the Host Portable Character Encoding. Otherwise, the result is implementation-dependent. When finished with it, a client must free the icon name string using XFree β thatβs not a suggestion, bestie. π
XGetIconName can generate a BadWindow error.
π¦ PROPERTIES π¦
WM_ICON_NAMEβ the name to be used in an icon. literally the iconβs name tag, iconic. π
π₯ DIAGNOSTICS π₯
BadAllocβ the server failed to allocate the requested resource or server memory. the server ran out of room, tragic.BadWindowβ a value for aWindowargument does not name a definedWindow. that window is not giving defined-window energy, fr fr. π
π SEE ALSO π
Go read these next, bestie β the whole Xlib friend group, no cap:
XAllocClassHint(3)XAllocIconSize(3)XAllocSizeHints(3)XAllocWMHints(3)XFree(3)XSetCommand(3)XSetTransientForHint(3)XSetTextProperty(3)XSetWMClientMachine(3)XSetWMColormapWindows(3)XSetWMName(3)XSetWMProperties(3)XSetWMProtocols(3)XStringListToTextProperty(3)Xlib - C Language X Interface
Source/version check: this page is from X Version 11, libX11 1.8.14, and itβs the XSetWMIconName(3) page. The footer doesnβt show a date, so Iβm not inventing one β periodt. π
β¨
π¦ where this page comes from
- alpine 3.24: libx11-doc 1.8.14-r0 Β· X11
- arch rolling: libx11 1.8.14-1 Β· MIT AND X11
- nixos 26.05: libx11 1.8.14
- nixpkgs unstable: libx11 1.8.14
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms