---
name: "xosd_display"
section: "3"
platform: "linux"
package: "xosd"
version: "2.2.14-12"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/xosd_display"
---

# xosd\_display(3)

Display data to an XOSD window

## NAME

xosd\_display - Display data to an XOSD window

## SYNOPSIS

\#include \<xosd.h\>

int **xosd\_display** (xosd \**osd*, int *line*, xosd\_command *command*, ...);

## DESCRIPTION

**xosd\_display** displays either a string, a percentage bar (like a progress bar) or a slider on an X display. The data is displayed in a borderless shaped-window, so it appears to float on top of the other windows, like the on-screen displays found in many televisions. Users cannot interact with the display in any way.

The data is displayed until the timeout limit, set by calling **xosd\_set\_timeout**(3), is reached, but **xosd\_display** returns immediately. If blocking is required **xosd\_wait\_until\_no\_display**(3) should be called after **xosd\_display**. A window that is displaying data can be hidden by calling [**xosd\_hide**(3)](/xosd_hide/3.md).

The type of data displayed is determined by the *command* argument. There are two types of data that can be displayed: text or integers.

### 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 formatted text is desired, pass **XOSD\_printf** as the argument to *command*, followed by string that has the same format as [**printf**(3)](/printf/3.md), and as many additional arguments as is required by the format string.

### Displaying Integer Values

Integer values (which must be within the range 0 to 100) can be displayed in two ways: a percentage-bar or a slider. A percentage bar looks like a volume display on a TV, and is created by passing **XOSD\_percentage** as the argument to *command*. A slider (see the XOSD plug-in for [**xmms**(1)](/xmms/1.md) for an example) is created 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.

- *line*

  The line of the display to change. The value of *line* must be less than *number\_lines*, set in the call to [**xosd\_create**(3)](/xosd_create/3.md).

- *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). For **XOSD\_string** and **XOSD\_printf** the number of characters written to the display is returned.

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.

## BUGS

There are no known bugs with **xosd\_display**. Bug reports can be sent to \<xosd@ignavus.net\>.

## SEE ALSO

 [**xosd\_create**(3)](/xosd_create/3.md), **xosd\_set\_timeout**(3), **xosd\_wait\_until\_no\_display**(3), [**xosd\_hide**(3)](/xosd_hide/3.md), [**printf**(3)](/printf/3.md).
