XSetCommand(3)

✨ NAME ✨

XSetCommand, XGetCommand β€” set or read a window's WM_COMMAND property. This is the XSetCommand(3) page from the XLIB FUNCTIONS manual, and yes bestie, we are getting into window command metadata today πŸ’…


πŸ› οΈ SYNTAX πŸ› οΈ

Exact signatures, no cap:

int XSetCommand(Display *display, Window w, char **argv, int argc);

Status XGetCommand(Display *display, Window w, char ***argv_return, int *argc_return);

🫢 ARGUMENTS 🫢

  • argc β€” the number of arguments. Just the count, bestie πŸ”’
  • argc_return β€” returns the number of arguments returned. This is where that returned count comes back to you.
  • argv β€” the application's argument list. This is the list you're handing over.
  • argv_return β€” returns the application's argument list. This is where the returned list comes back to you.
  • display β€” the connection to the X server. Your little server link πŸ“‘
  • w β€” the window. Which window? This one πŸͺŸ

πŸ’– DESCRIPTION πŸ’–

Okay so XSetCommand sets the command and arguments used to invoke the application. (Typically, argv is the argv array of your main program β€” iykyk.) If the strings are not in the Host Portable Character Encoding, the result is implementation-dependent, so that's the vibe check you have to pass. XSetCommand can generate BadAlloc and BadWindow errors.

XGetCommand reads the WM_COMMAND property from the specified window and returns a string list. If the WM_COMMAND property exists, it is of type STRING and format 8 β€” noted πŸ“ If sufficient memory can be allocated to contain the string list, XGetCommand fills in the argv_return and argc_return arguments and returns a nonzero status. Otherwise, or if any other error is encountered, it returns a zero status. If the data returned by the server is in the Latin Portable Character Encoding, then the returned strings are in the Host Portable Character Encoding. Otherwise, the result is implementation-dependent. To free the memory allocated to the string list, use XFreeStringList β€” free it, bestie, don't leak it 🫢

🏷️ PROPERTIES 🏷️

  • WM_COMMAND β€” the command and arguments, null-separated, used to invoke the application. Null-separated lineup, very demure πŸŽ€

🚨 DIAGNOSTICS 🚨

  • BadAlloc β€” the server failed to allocate the requested resource or server memory. Rude, but it happens 😭
  • BadWindow β€” a value for a Window argument does not name a defined Window. Basically that window is not a real one, bestie πŸ’€

πŸ”— SEE ALSO πŸ”—

Go be nosy, bestie β€” these are the related pages:


Final footer energy: X Version 11, libX11 1.8.14, and the XSetCommand(3) page β€” that's the source/version tea, and the date isn't even in the footer, so we're not inventing one πŸ’… mwah, bye bestie πŸ’‹πŸŽ€

πŸ“¦ where this page comes from