/guile-xosd

Guile bindings for libxosd

Primary LanguageCGNU General Public License v3.0GPL-3.0

-*- mode: org -*-

About

Guile-XOSD provides the Guile bindings for libxosd library.

Guile-XOSD is the reincarnation of lisposd. The C file with the Guile bindings was written at the time (2004-2005) by Yann Hodique, and the rest (GNU Build System infrastructure, guile modules, documentation and examples) was added as a part of Guile-XOSD in 2016 by Alex Kost.

Usage

From the following screenshots you can get the idea how Guile-XOSD may be used:

  • http://i.imgur.com/vNbFrDm.png
  • http://i.imgur.com/XCn4ysP.png

And here is the code to display the OSD from the second screenshot:

(use-modules (xosd))

(define osd
  (make-osd #:lines 2
            #:position 'top
            #:align 'center
            #:font "-*-ubuntu-bold-r-normal--*-500-*-*-p-*-*-1"
            #:color "dark green"
            #:outline-offset 1
            #:outline-color "white"))

(define (display-percentage percent)
  (display-string-in-osd osd (format #f "~a%" percent) 0)
  (display-percentage-in-osd osd percent 1))

(display-percentage 73)

The full documentation (texinfo manual) and a couple of other examples can be found in the source tree (and in the installed package).

Building from Git

Along with the obvious requirements for Guile-XOSD:

to build it from git, you also need:

Run ./autogen.sh to generate the build system infrastructure. After that, the program can be built and installed with the usual sequence of commands of the GNU Build System:

$ ./configure
$ make
# make install

It is possible to use/test Guile-XOSD without installing (i.e., after running make but before running make install) with the help of pre-inst-env script in the top build tree, like this:

$ ./pre-inst-env guile
scheme@(guile-user)> ,use(xosd)

Building/installing with Guix

The latest version of Guile-XOSD can be installed with GNU Guix: https://guix.gnu.org/en/packages/guile-xosd-0.2.2.

Also this repository contains guix.scm file which can be used to build/install Guile-XOSD using the git checkout, or to make a development environment for it (see the commentary in that file for more details).