An XOSD-inspired on-screen display (OSD) library with XFT support.
Go to file
2023-10-28 09:53:06 +13:00
archlinux Add support for setting shadow x and y offsets independently 2023-10-28 09:48:15 +13:00
man Removed empty files 2023-10-28 09:50:34 +13:00
src Removed empty files 2023-10-28 09:50:34 +13:00
.gitignore Add support for setting shadow x and y offsets independently 2023-10-28 09:48:15 +13:00
AUTHORS Initial public release 2021-06-30 13:01:32 +05:30
autobuild.sh Initial public release 2021-06-30 13:01:32 +05:30
ChangeLog Changed version number and updated changelog 2021-07-05 16:00:11 +05:30
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 Add support for setting shadow x and y offsets independently 2023-10-28 09:48:15 +13:00
Makefile.am Initial public release 2021-06-30 13:01:32 +05:30
NEWS Oops, it wants the NEWS file for some reason 2023-10-28 09:53:06 +13:00
README.md Add support for setting shadow x and y offsets independently 2023-10-28 09:48:15 +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

Installation

Manual installation

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

Arch

From the directory containing the PKGBUILD:

makepkg --syncdeps --install

Quick Look

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;
}