You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a new message arrives while the user is looking at (or interacting with) scli, it is not necessary to show a desktop (popup) notification, in addition to a notification in scli itself. Unfortunately, it is not easy to figure out where the user is looking :).
We could use some "proxy" metrics, like the time of the last keypress in scli, or check with the window manager weather scli's terminal window is currently active. These are not 100% reliable however.
The "keypress timeout" method is what signal-desktop seems to use. The problem with it is: if a new message arrives shortly enough (before the timeout has been reached) after the program's window became 'inactive' / not visible, the user has no notification of the new message.
The "current window" method requires querying a windows manager / server (through e.g. Xlib), which is not platform-independent. And if a terminal multiplexer such as tmux is used, then "scli's window is active" does not equate to "scli is in view" due to multiple "panes" / "tabs" / .. within the same window.
An example of using this method: undistract-me tool, that sends a notification when a long-running process finishes. It uses xprop, so works only with X, and does not know of tmux.
I don't know of a foolproof way of doing this. For now, scli simply shows a desktop notification for every incoming message.
The text was updated successfully, but these errors were encountered:
When a new message arrives while the user is looking at (or interacting with) scli, it is not necessary to show a desktop (popup) notification, in addition to a notification in scli itself. Unfortunately, it is not easy to figure out where the user is looking :).
We could use some "proxy" metrics, like the time of the last keypress in scli, or check with the window manager weather scli's terminal window is currently active. These are not 100% reliable however.
The "keypress timeout" method is what signal-desktop seems to use. The problem with it is: if a new message arrives shortly enough (before the timeout has been reached) after the program's window became 'inactive' / not visible, the user has no notification of the new message.
The "current window" method requires querying a windows manager / server (through e.g.
Xlib
), which is not platform-independent. And if a terminal multiplexer such astmux
is used, then "scli's window is active" does not equate to "scli is in view" due to multiple "panes" / "tabs" / .. within the same window.An example of using this method: undistract-me tool, that sends a notification when a long-running process finishes. It uses
xprop
, so works only with X, and does not know of tmux.I don't know of a foolproof way of doing this. For now, scli simply shows a desktop notification for every incoming message.
The text was updated successfully, but these errors were encountered: