XOSD_DISPLAY(3)

πŸ“¦
version 2.2.15 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ XOSD_DISPLAY ✨

okay bestie, gather round πŸ’– this one's the xosd_display(3) page β€” it lives in the XOSD manual, and it's literally the function that puts stuff on your screen. no cap.


🌸 NAME 🌸

xosd_display β€” display data to an XOSD window ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <xosd.h>

int xosd_display (xosd *osd, int line, xosd_command command, ...);

πŸ’… DESCRIPTION πŸ’…

so xosd_display shows one of three things on an X display: a string, a percentage bar (think progress bar energy), or a slider. the way it renders is in a borderless shaped-window, so it just kind of floats on top of all your other windows like the on-screen displays on, like, every TV ever. it's giving main character energy, honestly.

and the vibe check: users cannot interact with the display in any way. it's decorative. it's a moment. it's not a button. periodt. πŸ™ˆ

the data stays up until the timeout limit β€” the one you set by calling xosd_set_timeout(3) β€” gets reached, BUT xosd_display returns immediately. it does not wait around, she's busy. πŸ’… so if you actually need blocking, call xosd_wait_until_no_display(3) after xosd_display. and if you wanna hide a window that's currently showing data, that's xosd_hide(3)'s whole job.

which type of data you get is decided by the command argument. and there are exactly two types of data that can be displayed: text or integers. slay.

πŸ’– Displaying Textual Data πŸ’–

text is normally displayed by passing XOSD_string as the argument to command, followed by a string in UTF-8 format.

if you want formatted text (fancy!), pass XOSD_printf as the argument to command, followed by a string that has the same format as printf(3), plus as many additional arguments as the format string requires. iykyk 🧚

πŸ¦‹ Displaying Integer Values πŸ¦‹

integer values β€” and ngl these must be within the range 0 to 100 β€” can be displayed two ways: a percentage-bar or a slider.

  • a percentage bar looks like the volume display on a TV πŸ“Ί and you make it by passing XOSD_percentage as the argument to command.
  • a slider (peep the XOSD plug-in for xmms(1) if you want an example) is made by passing XOSD_slider as the argument to command.

an int between 0 and 100 is expected as the final argument when either XOSD_percentage or XOSD_slider is passed as the argument to command. ⭐


🌈 ARGUMENTS 🌈

  • osd β€” the XOSD window to use as the display. your canvas, bestie 🎨
  • line β€” the line of the display to change. and listen, the value of line must be less than number_lines, which is set in the call to xosd_create(3). don't try it, she will notice. πŸ’€
  • command β€” one of XOSD_percentage, XOSD_slider or XOSD_string. if the value of command is XOSD_string, then the next argument should be a string in UTF-8 format. if XOSD_percentage or XOSD_slider is given, then an int between 1 and 100 is expected as the next argument. πŸ‘‘

⭐ RETURN VALUE ⭐

if the command is either XOSD_percentage or XOSD_slider, then the integer value of the bar or slider is returned (between 1 and 100). ate.

for XOSD_string and XOSD_printf, the number of characters written to the display is returned. cute, informative, we love her. 🫢

on error, -1 is returned and xosd_error is set to indicate the reason for the error. 😭


πŸ’œ ENVIRONMENT πŸ’œ

  • char *xosd_error β€” a string describing the error, if one occurred.
  • enum xosd_command β€” the type of information that can be displayed, defined as an enumerated type. there are four values defined: XOSD_percentage, XOSD_string, XOSD_printf, and XOSD_slider.

πŸ‘‘ AUTHORS πŸ‘‘

the XOSD library was originally written by AndrΓ© Renaud, and is currently maintained by Tim Wright. this document was written by Michael JasonSmith. icons, all of them. πŸŽ€


πŸ’€ BUGS πŸ’€

there are no known bugs with xosd_display. not me being shocked. πŸ™ˆ

bug reports can be sent to <xosd@ignavus.net>.


🌸 SEE ALSO 🌸

xosd_create(3), xosd_set_timeout(3), xosd_wait_until_no_display(3), xosd_hide(3), printf(3).


and that's the whole page, bestie!! it's XOSD_DISPLAY(3) β€” that's the manual and the page name right there in the corner, and it's the one and only version of this doc. go forth and float some windows on top of everything else. βœ¨πŸ’–πŸ¦‹