XOSD_DISPLAY(3)
β¨ 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_percentageas the argument tocommand. - a slider (peep the XOSD plug-in for
xmms(1)if you want an example) is made by passingXOSD_slideras the argument tocommand.
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 oflinemust be less thannumber_lines, which is set in the call toxosd_create(3). don't try it, she will notice. πcommandβ one ofXOSD_percentage,XOSD_sliderorXOSD_string. if the value ofcommandisXOSD_string, then the next argument should be a string in UTF-8 format. ifXOSD_percentageorXOSD_slideris given, then anintbetween 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, andXOSD_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. β¨ππ¦
π¦ where this page comes from
- debian bookworm: libxosd-dev 2.2.14-2.1+b1
- debian trixie: libxosd-dev 2.2.15-1 Β· GPL-2.0-or-later
- ubuntu jammy: libxosd-dev 2.2.14-2.1build1
- ubuntu noble: libxosd-dev 2.2.14-2.1build1
- ubuntu questing: libxosd-dev 2.2.15-1.1
- ubuntu resolute: libxosd-dev 2.2.15-1.1build1 Β· GPL-2.0-or-later
- ubuntu stonking: libxosd-dev 2.2.15-1.1build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms