xosd_display - Display data to an XOSD window
, xosd_command command
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
(3xosd), is reached, but xosd_display
immediately. If blocking is required xosd_wait_until_no_display
should be called after xosd_display
. A window that is displaying data
can be hidden by calling xosd_hide
The type of data displayed is determined by the command
are two types of data that can be displayed: text or integers.
Text is normally displayed by passing XOSD_string
as the argument to
, followed by a string in UTF-8 format. If formatted text is
desired, pass XOSD_printf
as the argument to command
by string that has the same format as printf
(3), and as many additional
arguments as is required by the format string.
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
argument to command
. A slider (see the XOSD plug-in for xmms
for an example) is created by passing XOSD_slider
as the argument to
. An int
between 0 and 100 is expected as the final
argument when either XOSD_percentage
is passed as
the argument to command
- The XOSD window to use as the display.
- The line of the display to change. The value of line must be less
than number_lines, set in the call to xosd_create(3xosd).
- 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.
If the command
is either XOSD_percentage
then the integer value of the bar or slider is returned (between 1 and 100).
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
- 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.
The XOSD library was originally written by André Renaud, and is currently
maintained by Tim Wright. This document was written by Michael JasonSmith.
There are no known bugs with xosd_display
. Bug reports can be sent to