notify: add the notify-focus-inhibit config option

foot doesn't show desktop notifications (via OSC777) if the current
terminal has keyboard focus.

This is probably a sane default, but there are use cases where showing
a notification regardless of the focus status may be desired. For
example, a completion notification of a long running task inside a
non-focused tmux window.

This PR adds the notify-focus-inhibit option which can be used to
disable inhibition of notifications when the window has focus.

The default value is `yes`, which retains the old behavior.
This commit is contained in:
Mitja Horvat 2021-10-05 23:07:01 +02:00
parent b1c03861cd
commit 729f7466ae
6 changed files with 27 additions and 8 deletions

View file

@ -279,11 +279,17 @@ in this order:
- OSC 777: *\\e]777;notify;<title>;<body>\\e\\\\*
Notifications are *inhibited* if the foot window has keyboard
focus.
By default, notifications are *inhibited* if the foot window
has keyboard focus. See _notify-focus-inhibit_.
Default: _notify-send -a ${app-id} -i ${app-id} ${title} ${body}_.
*notify-focus-inhibit*
Boolean. If enabled, foot will not display notifications if the
terminal window has keyboard focus.
Default: _yes_
*selection-target*
Clipboard target to automatically copy selected text to. One of
*none*, *primary*, *clipboard* or *both*. Default: _primary_.
@ -316,8 +322,10 @@ in this order:
*notify*
When set to _yes_, foot will emit a desktop notification using
the command specified in the *notify* option whenever *BEL* is
received and the window does *not* have keyboard focus. Default:
_no_
received. By default, bell notifications are shown only when the
window does *not* have keyboard focus. See _notify-focus-inhibit_.
Default: _no_
*command*
When set, foot will execute this command when *BEL* is received.