An XOSD-inspired on-screen display (OSD) library with XFT support.
Go to file
2024-02-04 22:07:58 +13:00
archlinux Update CHANGELOG for 2.0.0 release, add and to makedepends for PKGBUILD, expand README and condense AUTHORS 2023-11-01 03:59:52 +13:00
man Removed empty files 2023-10-28 09:50:34 +13:00
src Fix a misspelled function name in a comment 2024-02-04 21:46:52 +13:00
.gitignore Fix a few comments in xosd-xft.c, update gitignore to ignore Arch package build stuff 2024-02-04 20:47:09 +13:00
AUTHORS.md Update CHANGELOG for 2.0.0 release, add and to makedepends for PKGBUILD, expand README and condense AUTHORS 2023-11-01 03:59:52 +13:00
autobuild.sh Added to autobuild.sh to hopefully get rid of autotools errors 2023-11-01 04:06:24 +13:00
CHANGELOG.md -Actually- fix links in changelog (removed "v" from version tags) 2023-11-01 04:14:09 +13:00
configure.ac Add support for setting shadow x and y offsets independently 2023-10-28 09:48:15 +13:00
COPYING Updated symbolic likes to file copies and crated PKGBUILD 2021-06-30 15:03:32 +05:30
COPYING.LESSER Initial public release 2021-06-30 13:01:32 +05:30
INSTALL Updated symbolic likes to file copies and crated PKGBUILD 2021-06-30 15:03:32 +05:30
install-sh Put the autotools generated files back for now 2023-10-28 05:29:15 +13:00
libxosd-xft.cbp Remove mingw search directories in Code::Blocks project 2024-02-04 22:07:58 +13:00
Makefile.am Renamed changelog file to conform to conventions, and modified Makefile.am so it won't give errors about missing NEWS or ChangeLog files. 2023-10-28 11:31:20 +13:00
README.md Update CHANGELOG for 2.0.0 release, add and to makedepends for PKGBUILD, expand README and condense AUTHORS 2023-11-01 03:59:52 +13:00
xosd-xft.pc.in Initial public release 2021-06-30 13:01:32 +05:30

XOSD-XFT - OSD for X11

Inspired by libxosd.

xosd-xft supports:

  • Use of Xft/TTF fonts
  • XRandR and Xinerama extensions
  • Allows you to choose a monitor in multihead setups - including active monitor
  • Use osd-echo to display a Nerd Font glyph
  • Use osd-cat to display a file

Building and Installing

GNU Autotools is required for building.

Arch

To build a package, run this command in the directory containing the PKGBUILD:

makepkg --syncdeps --install

Manual installation

Instructions may vary depending on your system, but this is a general guideline.

Installing required packages on Arch-based systems (including Manjaro)

Required dependencies for building:

sudo pacman -S libxt libxft libxext xorg-util-macros

For building with XRandR and Xinerama extensions:

sudo pacman -S libxrandr libxinerama

Installing required packages on Debian-based systems (including Ubuntu and Linux Mint)

Required packages for building:

sudo apt-get install libxt-dev libxft-dev libxext-dev xutils-dev

XRandR and Xinerama extensions:

sudo apt-get install libxrandr-dev libxinerama-dev

Installing required packages on RPM-based systems (including Fedora and CentOS)

Required packages for building:

dnf install libXt-devel libXft-devel libXext-devel xorg-x11-util-macros

XRandR and Xinerama extensions:

dnf install libXrandr libXinerama

Building

From the source directory:

./autobuild.sh
./configure
make -j$(nproc)
sudo make install

Brief Examples

Using osd-echo

To display volume off glyph and execute amixer command:

    osd-echo -e 'amixer set Master off' :fa-volume_off:

To list available glyph names that contain volume in them:

    osd-echo -lvolume

Using osd-cat

To override the font used to display a file:

    osd-cat -f "SourceCodePro:size=14" /etc/passwd

The following command shows the output of uptime on the screen and updates every 5 seconds:

while true; do uptime; sleep 5; done | osd-cat --number-of-lines 1 -g 0x1l+0-0

Using the library

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>

#include <xosd-xft.h>

xosd_xft *osd;

int main(int argc, char *argv[])
{
  osd_geometry g;

  xosd_xft *osd = osd_create();
  if(osd_parse_geometry("300x300+0+0*middle/center", "center/middle", &g) == NULL) {
    fprintf(stderr, "%s\n", osd_error);
    return EXIT_FAILURE;
  }
  osd_set_geometry(osd, &g);
  osd_set_font(osd, "mono:size=16");
  osd_set_color(osd, "lightblue", 100);
  osd_set_bgcolor(osd, "black", 100);

  char* message = "HELLO XOSD-XFT" ;
  osd_display(osd, message, strlen(message));

  usleep(1000000);
  osd_destroy(osd);
  return EXIT_SUCCESS;
}