nfy

Minimal and daemonless notification program for X
git clone git://git.christosmarg.xyz/nfy.git
Log | Files | Refs | README | LICENSE

commit 8f98225c62b626321bd7cf80531656b33a34aadf
parent 719a73b051ccac28c662bd42d2f97f7c8ed6f3d5
Author: Christos Margiolis <christos@margiolis.net>
Date:   Wed, 24 Nov 2021 02:48:00 +0200

edited README

Diffstat:
MREADME | 25++++++++++++++++---------
Mnfy.c | 10++++------
2 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/README b/README @@ -1,20 +1,22 @@ -nfy - a minimal and daemonless notification program for X -========================================================= -nfy creates a temporary notification popup window and displays -all the arguments that were passed to it. +nfy +=== -Dependencies: -------------- +nfy is a minimal and daemonless notification program for X. +It creates a temporary notification popup window and displays +all the arguments that were passed to it. Yes, it can queue +notifications as well. + +Dependencies +------------ - Xlib - libXft - libXrandr -Usage: ------- +Usage +----- Edit config.mk and config.h to match your particular setup and preferences. - $ make # make install clean $ nfy str... @@ -22,4 +24,9 @@ nfy will be installed in `/usr/local/bin` by default. Configuration is done by editing config.h and recompiling the source code. +Configuration is done by editing `config.h` and recompiling the +source code. + Read the manpage for more. + +Report any bugs to <christos@margiolis.net>. diff --git a/nfy.c b/nfy.c @@ -45,7 +45,7 @@ main(int argc, char *argv[]) XEvent ev; XRRCrtcInfo *info = NULL; XRRScreenResources *screens; - XSetWindowAttributes attrs; + XSetWindowAttributes attrs = {0}; XftColor color; XftDraw *drw; XftFont *font; @@ -104,6 +104,7 @@ main(int argc, char *argv[]) font = XftFontOpenName(dpy, scr, fonts); th = font->ascent - font->descent; + XftColorAllocName(dpy, vis, colormap, fontcolor, &color); w = 0; for (i = argi; i < argc; i++) { @@ -143,16 +144,13 @@ main(int argc, char *argv[]) win = XCreateWindow(dpy, RootWindow(dpy, scr), x, y, w, h, borderw, DefaultDepth(dpy, scr), CopyFromParent, vis, CWOverrideRedirect | CWBackPixel | CWBorderPixel, &attrs); - drw = XftDrawCreate(dpy, win, vis, colormap); - XftColorAllocName(dpy, vis, colormap, fontcolor, &color); - XSelectInput(dpy, win, ExposureMask | ButtonPress); XMapWindow(dpy, win); sig.sa_handler = sighandler; sig.sa_flags = SA_RESTART; - (void)sigemptyset(&sig.sa_mask); + (void)sigfillset(&sig.sa_mask); if (sigaction(SIGALRM, &sig, NULL) < 0) err(1, "sigaction(SIGALRM)"); if (sigaction(SIGTERM, &sig, NULL) < 0) @@ -190,5 +188,5 @@ main(int argc, char *argv[]) XCloseDisplay(dpy); (void)close(lockfd); - return 0; + return (0); }