Tree


.gitignorecommits | blame
LICENSE.mdcommits | blame
Makefilecommits | blame
README.mdcommits | blame
bxnotify.1commits | blame
bxnotify.ccommits | blame
config.def.hcommits | blame

README.md

# bxnotify

A very basic X notification tool.

## Just a Heads-Up

I needed a way to display a short message on screen from a shell 
script or a Lua program. I did not need a notification daemon, a 
dbus service, or a background process. I just needed a small 
program that reads text from stdin and shows it.

bxnotify is the result: a one-shot notification renderer. Each 
invocation displays a single notification, then exits. Concurrent 
invocations stack vertically, so multiple notifications can be 
visible at once.

## Dependencies

- Xlib
- Xft
- A C compiler compliant with the C11 standard.

## Build

Compile __bxnotify__ from source.

```
make
```


## Install

Install the binary and man page. Note that root privileges are not 
required as the default destination is `~/.local/`.

```
make install
```


## Uninstall

Remove the binary and man page.

```
make uninstall
```


## Configuration

__bxnotify__ is configured at compile-time by editing config.def.h. 
After making changes, the program must be recompiled and 
reinstalled. See bxnotify(1) for details.

Command line flags override configuration defaults for font, 
colors, alignment, and duration.

## Design & Functionality

__bxnotify__ is built around a set of opinionated primitives:

- One-shot renderer: reads from stdin, shows a notification, exits
- Concurrent notifications stack vertically
- Auto-sized height based on the number of input lines
- Word wraps long lines to fit the configured width
- Dismissed with Mod4+q (sends SIGUSR1 to the owning process)
- Configurable duration in seconds (0 = persist until dismissed)
- Runtime registry at `~/.local/tmp/bxnotify.reg` for stacking, 
  coordinated with flock(2) and pruned with kill(2)

## Usage

Send a notification from the shell.

```
echo “Notify me about this” | bxnotify
```

Send a multi-line notification.

```
printf “Notify me about this\nNotify me about that” | bxnotify
```

Send a notification with a custom duration.

```
echo “Notify me for a long time” | bxnotify -d 30
```

Send a notification from a Lua script.

```
os.execute("echo 'Notify me about this' | bxnotify")
```

When used with bxwm(1) and bxbar(1), bxnotify complements the
suite by providing visual feedback for system events and scripts
without requiring dbus or a notification daemon.