XNOTIFY(1)
π NAME π
okay so bestie, welcome to the XNOTIFY(1) page from the General Commands Manual. This one is all about xnotify β literally the program that pops up a notification on the screen. That's the whole name vibe: xnotify β popup a notification on the screen. β¨
β¨ SYNOPSIS β¨
xnotify [-ow] [-G gravity] [-b button] [-g geometry] [-h height] [-m monitor] [-s seconds]
π DESCRIPTION π
so xnotify is a notification launcher for X, bestie. It receives a notification specification from standard input and shows a notification on the screen. The notification disappears automatically after a given number of seconds, or after a mouse click happens on it. iconic behavior π
The options are as follows:
-Ggravity β Specify the gravity, that is, where in the screen to displayxnotify.gravitycan be"NE"forNorthEastGravity(display on the top right corner of the screen);"SE"forSouthEastGravity(display on the bottom right corner of the screen);"C"forCenterGravity(display on the center of the screen); etc.-bbutton β Specifies a number between1and5to be the mouse action button. When clicking over a notification with the action button, the notification will close, andxnotifywill output to itsstdoutthe value of the notification'sCMD:option.-ggeometry β Specifies the geometry in the form[<WIDTH>x<HEIGHT>][{-+}<XOFFSET>{-+}<YOFFSET>]. Replace<WIDTH>by the desired width,<HEIGHT>by the desired minimum height, and so on. The height is the minimum height of a notification; a notification that contains more than one line or an image can get bigger than this minimum height. A value of0sets a field to the default value. So, for example,-g 0x80+0+0set the minimum height to80pixels while maintaining other values to the default.<XOFFSET>and<YOFFSET>can be preceded by either a minus or a plus (meaning negative or positive values). Fields in square brackets are optional. So, for example,-g 0x80is the same as-g 0x80+0+0; and-g -10+10is the same as-g 0x0-10+10.-hheight β Maximum height (in pixels) of a notification window.-mmonitor β Makesxnotifybe displayed on the specified monitor. Monitor numbers start from0. Without this option,xnotifyis displayed on the first monitor (that is, the monitor0).-oβ With this option, only one notification should exist at a time. So, when a new notification appears, the other ones are removed.-sseconds β Specify the time, in seconds, for a notification to be displayed before it is removed from screen. Without this option, the default of10seconds is used. If this option is set to0(zero), the notification is displayed indefinitely until manually closed.-wβ Let the window manager control notification windows.
π¦ notification input format π¦
Each line read from stdin specify a notification and has the following format:
ITEM := [NAME:VALUE TABS] TEXT NEWLINE
That means that each line is composed by an optional set of name-value pairs separated by colon (:) followed by tabs, then the text of the notification, then a newline. Brackets group optional elements. Empty lines are ignored.
The TEXT of a notification specification can contain tabs. Each tab is converted to a line break on the notification.
The following names are currently accepted for the NAME:VALUE pairs:
IMG:β Specify the path of a image to be displayed on the notification.TAG:β Specify a string to be the notification's tag. When a notification with a given tag spawns, all other notifications with the same tag disappears.CMD:β Specify a string to be output when clicking on the notification with the action mouse button.BG:β Specify the color of the notification background.FG:β Specify the color of the notification text (i.e., its foreground).BAR:β Specify a percentage for a progress bar to be drawn below the text.BRD:β Specify the color of the notification border.SEC:β Specify the time, in seconds, that the notification should stay visible. If set to zero, the notification will stay visible until being clicked.
Clicking on a notification removes it from the screen. π«Ά
πΈ ENVIRONMENT πΈ
The following environment variables affect the execution of xnotify
DISPLAYβ The display to startxnotifyon.
π¦ RESOURCES π¦
xnotify understands the following X resources.
xnotify.title.faceNameβ The fonts to draw the notification title text. The title is the first line of the notification, if there is more than one. More than one font can be specified, separated by comma (,). If more than one font is specified, the first font with a given glyph is used to display that glyph on the screen.xnotify.body.faceNameβ The fonts to draw the notification body text. The body text is any line after the first line.xnotify.backgroundβ The color of the notification background.xnotify.foregroundβ The color of the notification text.xnotify.borderβ The color of the border around a notification.xnotify.geometryβ The geometry in the form[<WIDTH>x<HEIGHT>][{+-}<XOFFSET>{+-}<YOFFSET>]. See the description of the option-gfor more information.xnotify.gravityβ Where in the screen to display notifications. See the description of the option-Gfor more information.xnotify.borderWidthβ The size in pixels of the border around a notification.xnotify.maxHeightβ The maximum height of a notification window in pixels.xnotify.gapβ The gap between notifications.xnotify.imageWidthβ The size of the image attached to the notification.xnotify.leadingβ The space between lines.xnotify.paddingβ The space around the content inside the notification popup window.xnotify.shrinkβ If set to"true", the notification width will shrink to its content size. If set to"false", notification width will be constant.xnotify.alignmentβ If set to"left","center", or"right", text is aligned to the left, center, or right of the popup window, respectively. By default, notification text is aligned to the left of the notification popup window.xnotify.alignTopβ If set to"true", The text will be vertically aligned to the top of the notification window. If set to"false", text will be vertically centered.xnotify.wrapβ If set to"true", lines longer than the notification width will wrap rather than being truncated. If set to"false", lines will be truncated.
π SIGNALS π
xnotify respond to signals sent to it.
SIGHUPβ Close all notifications.SIGUSR1β Close the first notification.SIGUSR2β Print theCMDof the first notification and then close it.SIGSTOPβ Stopxnotify. When this signal is sent, all new notifications are accumulated untilxnotifyreceive aSIGCONTsignal. This signal is useful to be sent when a window is fullscreen, soxnotifywill not annoy with notifications on top of the fullscreen window. ASIGHUPsignal must be sent before aSIGSTOPin order to close all notifications before stop.SIGCONTβ Display all accumulated notifications and continuexnotifyafter being stop withSIGSTOP.
π₯ EXAMPLES π₯
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, the following lines can be placed on ~/.xinitrc. This will create a named pipe unique to the current X display in the 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 &
Then a notification can be created by echoing into the named pipe:
$ echo Hello World > $XNOTIFY_FIFO
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
xnotify does not read notifications from dbus. For xnotify to read dbus notifications, its stdin must be fed with the output of tiramisu(1). The following line makes tiramisu(1) send dbus notifications to xnotify. This line can be added to ~/.xinitrc after the line calling xnotify.
tiramisu -o "$(printf '#summary\t#body\n')" > $XNOTIFY_FIFO &
π SEE ALSO π
tiramisu(1), herbe(1)
π and that's the whole XNOTIFY(1) page, bestie β General Commands Manual energy, footer is literally just XNOTIFY(1) with no extra source/version/date line here. go forth and notify, periodt π
β¨
π¦ where this page comes from
- nixos 26.05: xnotify 0.9.3
- nixpkgs unstable: xnotify 0.9.3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms