• Stars
    star
    158
  • Rank 237,131 (Top 5 %)
  • Language
    C
  • License
    MIT License
  • Created about 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

read notifications from stdin and pop them up on the screen

XNotify

XNotify displays a notification on the screen. XNotify receives a notification specification in stdin and shows a notification for the user on the screen.

See the manual for more information on how xnotify works.

Features

XNotify comes with the following features:

  • xnotify receives notifications from stdin. You can use a fifo to echo notifications on the fly like

    echo Hello World > /path/to/xnotify.fifo

  • xnotify queue notifications and display them one above the other.

  • Image support, just prefix the notification string with IMG:/path/to/the/file.png and a tab.

  • Multiple monitor support. You can set the monitor with the -m option.

  • Support for fallback fonts (you can set more than one fonts, that will be tried in order).

  • X resources support (you don't need to recompile Xnotify for configuring it).

Files

The files are:

  • ./README: This file.
  • ./Makefile: The makefile.
  • ./config.h: The hardcoded default configuration for XNotify.
  • ./config.mk: The setup for the makefile.
  • ./xnotify.{c,h}: The source code of XNotify.

Installation

First, edit ./config.mk to match your local setup.

In order to build XNotify you need the Imlib2, Xlib and Xft header files. The default configuration for XNotify is specified in the file config.h, you can edit it, but most configuration can be changed at runtime via X resources and via command-line options. Enter the following command to build XNotify. This command creates the binary file ./xnotify.

make

By default, XNotify is installed into the /usr/local prefix. Enter the following command to install XNotify (if necessary as root). This command installs the binary file ./xnotify into the ${PREFIX}/bin/ directory, and the manual file ./xnotify.1 into ${MANPREFIX}/man1/ directory.

make install

Running XNotify

XNotify receives as input one line per notification. Each line is made out of a notification title and a notification body separated by any number of tabs. Lines without a title are ignored.

The following is an example of how to run XNotify

$ xnotify -m 10 -G NE -g -10+10 -s 15

This line means: read notifications from stdin, display the notifications on the north east (-G NE) of the monitor 0 (-m 0), that is, on the upper right corner of the first monitor. The notifications should be placed 10 pixels to the left and 10 pixels down (thus creating a 10 pixel gap with the upper right corner). Each notification stay alive for 15 seconds.

To create a named pipe for XNotify, you can place the following in the beginning of your ~/.xinitrc. This will create a named pipe unique to your current X display in your home directory at ~/.cache. Then, it will open xnotify in the background, reading from this named pipe.

XNOTIFY_FIFO="$HOME/.cache/xnotify$DISPLAY.fifo"
export XNOTIFY_FIFO
rm -f $XNOTIFY_FIFO
mkfifo $XNOTIFY_FIFO
xnotify 0<>$XNOTIFY_FIFO

Note that the first two lines (the line setting the environment variable and the line exporting it) should be at the beginning of your ~/.xinitrc, so other programs you invoke are aware of this variable.

To create a notification with a image, input to XNotify a line beginning with IMG:/path/to/file.png followed by a tab. For example:

$ printf 'IMG:/path/to/file.png\tThis is a notification\n' > $XNOTIFY_FIFO

To read dbus notifications from stdin, you'll need tiramisu. Then add the following line to your .xinitrc, after the line calling xnotify.

$ tiramisu -o "$(printf '#summary\t#body\n')" > $XNOTIFY_FIFO &

To use a different size other than the default for the notifications, run xnotify with the -g option set to the notification size in WIDTHxHEIGHT. For example:

$ xnotify -g 300x80

The argument for the -g option has the form [WIDTHxHEIGHT][{+-}XPOS{+-}YPOS]. Parts between square brackets are optional. {+-} means to chose either + or -.

More Repositories

1

xmenu

a x11 menu utility
C
291
star
2

jvm

simple java virtual machine
C
248
star
3

pmenu

A pie-menu in xlib and imlib2.
C
206
star
4

shod

mouse-based window manager that can tile windows inside floating containers
C
170
star
5

xfiles

Configurable and simple file manager for X11
C
97
star
6

xprompt

A dmenu rip-off with contextual completion
C
96
star
7

xclickroot

click on root window and run a command
C
84
star
8

shod-old

hybrid (floating and tiling) tabbed window manager
C
56
star
9

xnotes

some notes on Xlib programming
C
29
star
10

legv8

LEGv8 CPU implementation and some tools like a LEGv8 assembler
Verilog
27
star
11

aoc

solutions for advent of code in awk
Awk
23
star
12

fmutils

File management utilities in POSIX shell scripts.
Shell
19
star
13

paginator

X11 desktop pager dockapp
C
17
star
14

pomod

pomodoro daemon
C
15
star
15

xutils

X utilities in POSIX shell scripts.
Roff
12
star
16

man2md

man page to markdown converter
Awk
12
star
17

plumb

yet another plumbing utility for UNIX
C
11
star
18

home

dotfiles etc
Shell
10
star
19

xclimsg

send X11 client message
C
10
star
20

catb-mb

The Cathedral and the Bazaar: A troff -mb Unauthorized Edition
Roff
9
star
21

ctrlmenu

unified menu system for X11 (sxhkd + xmenu + dmenu)
C
9
star
22

incipit

the incipit plain text markup language, and some troff macro packages
Roff
9
star
23

calendar

print upcoming events
Awk
8
star
24

hexadecaicons

personal collection of 16x16 xpm icons
Makefile
8
star
25

seninha.org

personal website
Awk
7
star
26

simp

A Simplistic Programming Language
C
7
star
27

xcliputils

X11 clipboard management utilities
C
7
star
28

cwdof

Get current working directory of a given process in OpenBSD.
C
7
star
29

mpv-concat

mpv script to interactively create a input file for ffmpeg -f concat
Lua
7
star
30

simpletron

The Simpletron Simulator and The Simple Basic Compiler
C
6
star
31

haiku-icons

Haiku icon theme; can be built into svg and/or png XDG-compliant icon set
Shell
6
star
32

xfilter

X11 interactive filter
C
6
star
33

wmlaunchbutton

docked button to launch a command
C
6
star
34

control

The libcontrol Xt-based X11 widget toolkit
C
6
star
35

vcd2svg

Draw waveform from a vcd file into a svg image
Awk
6
star
36

orgutils

personal organization utilities
C
6
star
37

graph

graph drawing program, from The AWK Programming Language book, but with unicode braille characters
Awk
6
star
38

xurgent

set window urgency hint or demands-attention state
Roff
5
star
39

focus

Focus window, workspace or monitor by direction or cycle through them.
C
5
star
40

wmpdart

mpd client and window maker dockapp that shows album art
C
5
star
41

9ball

bouncing ball game for Plan 9
C
5
star
42

automata.scm

implementation of automata in r7rs scheme
Scheme
4
star
43

hoc

high order calculator: an interpreter for a simple language for floating point arithmetic
C
4
star
44

todo

print next tasks
Awk
4
star
45

lsd

list desktops
C
3
star
46

lsc

list X11 clients
C
3
star
47

closest

focus the closest window in a given direction
3
star
48

expenv

expand environment variables
Awk
3
star
49

readme

README reader
Makefile
2
star
50

tbgen

Testbench generator in AWK for Verilog modules
Shell
2
star
51

wrappers

wrappers around some programs
Shell
2
star
52

fqa

9front fqa rewritten in incipit
Roff
2
star
53

rolldice

roll virtual dice
C
2
star
54

xbindecho

echo something when a key (or mouse button) is pressed
C
2
star
55

rsa

RSA command-line utilities (THIS IS A COLLEGE PROJECT; USE IT FOR EDUCATIONAL PURPOSES ONLY!)
C
2
star
56

webdump

HTML to plain-text converter for webpages (seninha's fork with seninha's preferences hardcoded)
C
1
star
57

jbounce

bouncing ball game based on JezzBall
Java
1
star
58

skip

skip text between two strings
Awk
1
star
59

maori

Notas sobre a língua Māori em Português.
Makefile
1
star
60

tadepe

What if the cyrillic and latin alphabets had a child?
Awk
1
star
61

phillbush

phillbush
1
star
62

nixers2021

source for the slides used during my presentation at nixers.net conf 2021
Roff
1
star
63

automata.pic

troff's pic(1) macros to draw finite-state machines
Roff
1
star