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 the XTextProperty structure to be used.
  • text_prop_return β€” returns the XTextProperty structure.
  • 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 a Window argument does not name a defined Window. that window is not giving defined-window energy, fr fr. πŸ’€

🌈 SEE ALSO 🌈

Go read these next, bestie β€” the whole Xlib friend group, no cap:


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