2024-03-24 08:22:53 +00:00
|
|
|
# this file defines the `scripts` entry within ~/.config/swaync/config.json.
|
|
|
|
# it describes special things to do in response to specific notifications,
|
|
|
|
# e.g. sound a ringer when we get a call, ...
|
|
|
|
{ pkgs }:
|
|
|
|
{
|
|
|
|
# a script can match regex on these fields. only fired if all listed fields match:
|
|
|
|
# - app-name
|
|
|
|
# - desktop-entry
|
|
|
|
# - summary
|
|
|
|
# - body
|
|
|
|
# - urgency (Low/Normal/Critical)
|
|
|
|
# - category
|
|
|
|
# additionally, the script can be run either on receipt or action:
|
|
|
|
# - run-on = "receive" or "action"
|
|
|
|
# when script is run, these env vars are available:
|
|
|
|
# - SWAYNC_BODY
|
|
|
|
# - SWAYNC_DESKTOP_ENTRY
|
|
|
|
# - SWAYNC_URGENCY
|
|
|
|
# - SWAYNC_TIME
|
|
|
|
# - SWAYNC_APP_NAME
|
|
|
|
# - SWAYNC_CATEGORY
|
|
|
|
# - SWAYNC_REPLACES_ID
|
|
|
|
# - SWAYNC_ID
|
|
|
|
# - SWAYNC_SUMMARY
|
|
|
|
|
|
|
|
# rules to use for testing. trigger with:
|
2024-04-16 02:18:35 +00:00
|
|
|
# - `notify-send --app-id=foo subject body` (etc)
|
2024-03-24 08:22:53 +00:00
|
|
|
# should also be possible to trigger via any messaging app
|
|
|
|
fbcli-test-im = {
|
|
|
|
body = "test:message";
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli start proxied-message-new-instant";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
fbcli-test-call = {
|
2024-04-16 02:18:35 +00:00
|
|
|
body = "test:call-start";
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli start phone-incoming-call";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
fbcli-test-call-stop = {
|
|
|
|
body = "test:call-stop";
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli stop phone-incoming-call";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
incoming-im-known-app-name = {
|
|
|
|
# trigger notification sound on behalf of these IM clients.
|
|
|
|
app-name = "(Chats|Dino|discord|dissent|Element|Fractal)";
|
|
|
|
body = "^(?!Incoming call).*$"; #< don't match Dino Incoming calls
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli start proxied-message-new-instant";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
incoming-im-known-desktop-entry = {
|
|
|
|
# trigger notification sound on behalf of these IM clients.
|
|
|
|
# these clients don't have an app-name (listed as "<unknown>"), but do have a desktop-entry
|
|
|
|
desktop-entry = "com.github.uowuo.abaddon";
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli start proxied-message-new-instant";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
incoming-call = {
|
|
|
|
app-name = "Dino";
|
|
|
|
body = "^Incoming call$";
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli start phone-incoming-call";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
incoming-call-acted-on = {
|
|
|
|
# when the notification is clicked, stop sounding the ringer
|
|
|
|
app-name = "Dino";
|
|
|
|
body = "^Incoming call$";
|
|
|
|
run-on = "action";
|
2024-04-15 18:00:51 +00:00
|
|
|
exec = "swaync-fbcli stop phone-incoming-call";
|
2024-03-24 08:22:53 +00:00
|
|
|
};
|
|
|
|
}
|