---
name: "xosd_set_bar_length"
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_set_bar_length"
---

# xosd\_set\_bar\_length(3)

Change the length of the percentage bar or slider

## NAME

xosd\_set\_bar\_length - Change the length of the percentage bar or slider

## SYNOPSIS

\#include \<xosd.h\>

int **xosd\_set\_bar\_length** (xosd \**osd*, int *displayPercentage*);

## DESCRIPTION

**xosd\_set\_bar\_length** changes the percentage of the display used by a slider or percentage bar. Normally the XOSD choses a sensible length for the bar, but you may wish to change the default behavior if there are only a small number of possible values to be displayed.

## ARGUMENTS

- *osd*

  The XOSD window to alter.

- *displayPercentage*

  The percentage of the display to be used up by the slider or percentage bar, as an interger between 0 and 100. Setting *displayPercentage* to -1 reverts to the default behaviour.

## RETURN VALUE

On success, a zero 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.

## BUGS

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

## AUTHORS

The XOSD library was originally written by André Renaud, and is currently maintained by Tim Wright. This document was written by Michael JasonSmith.

## SEE ALSO

 [**xosd\_create**(3)](/xosd_create/3.md), [**xosd\_display**(3)](/xosd_display/3.md).
