Skip to content

About

Notification system that provides a Rofi front-end

Resources

Stars

27 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Rofication

Rofication is a minimalistic notification system. It is loosely modeled after notification centers on Android and Windows 10. The main idea is to not annoy (e.g. overlap parts of my desktop) but still keep a persistent list of messages. Notifications are useful, however too many notifications showing up too often (e.g. work mail popups) distract from the current task and are therefore dismissed without proper reviewing. The goal is to show (in a single clear place) there are notifications but not pop them up. It is up to the user to review the notifications when time is available. If things are critical one should use a more direct media (e.g. face to face or phone).

To summarize Rofications, it has:

  • 1 point to see if there are notifications. For example the status bar of your Desktop Environment. Notification Bar
  • An application to (re)view all open notifications. Notification Bar
  • Persistent notifications, they stay around until dismissed. They should stick around, even over reboots.

Techniques used

Rofication implements a notification daemon following the Galago Desktop Notification standard. This is used by most Linux desktop environments and most relevant applications support this. It is easily scriptable using notify-send. Rofication aims to be a drop-in replacement for existing notification daemons.

Rofication tries to re-use existing code as much as possible. It uses Rofi for displaying, i3blocks for the unintrusive notification and Python for d-bus implementation of notification daemon.

Structure

The main structure is like depicted below. The daemon acts as a storage point for the dbus messages generated by the applications. The unix-socket interface allows clients to query the storage. A proper protocol still has to be defined.

┌─────────────┐           ┌───────────────────┐                      ┌────────────────┐
│ application │ --dbus--> │ rofication-daemon │ <--- unix-socket --> │ rofication-gui │
└─────────────┘           └───────────────────┘       │              └────────────────┘
                                |                     │             ┌──────────────────────────┐
                                |                     \-----------> │ rofication-statusi3blocks│
                            <hdd:json-db>                           └──────────────────────────┘

The components consist of:

Daemon

Rofication daemon is a small Python script that listens for notification messages on the local dbus. Notifications are internally queued (and preserved) and can be viewed by a client via a unix-socket. It is just a simple storage for notifications.

Some applications should only ever have one notification in the queue: a new notification from them replaces the previous one. The daemon reads this list of application names (comma-separated) at startup from the Xresource rofication.notify.single_notification_apps, or from the environment variable rofication_notify_single_notification_apps. The default is VLC media player. Example:

rofication.notify.single_notification_apps: VLC media player, Spotify

The daemon listens on the UNIX socket rofi_notification_daemon in $XDG_RUNTIME_DIR, or in /tmp/rofication-<uid> when that variable isn't set; only the user running it can connect. The old path /tmp/rofi_notification_daemon is made a link to that socket, for clients that still use it. One daemon runs per user: a daemon started while another one runs with the same runtime directory or the same saved queue exits. Start it with --replace to stop the running daemon and take over all the notifications it holds.

Notification

Rofication does not implement its own 'widget' to display notifications. Instead it can be easily integrated into existing tools. Currently we ship a small script to integrate into i3-blocks. This shows the number of notifications and signals when there are critical notifications. Ideally there should be several small scripts that implement this for different desktop environments.

GUI

The Rofication GUI consists of a small Python script wrapping Rofi. The GUI allows the user to view notifications, mark them as seen and dismiss them.

The keys are passed to rofi as -kb-* options. Each one can be changed with the Xresource rofication.notify.<option>, or the environment variable rofication_notify_<option> with - replaced by _ (for example rofication_notify_kb_custom_1). The values use rofi's key binding syntax. A comma separates alternative keys, and an empty value unbinds the action.

Xresource Action Default
rofication.notify.kb-custom-1 Dismiss the notification Delete
rofication.notify.kb-custom-2 Mark the notification as seen Return
rofication.notify.kb-custom-3 Refresh the list Alt+r
rofication.notify.kb-custom-4 Dismiss all notifications of the app Shift+Delete
rofication.notify.kb-accept-entry rofi kb-accept-entry (close the viewer) Control+j,Control+m,KP_Enter
rofication.notify.kb-remove-char-forward rofi kb-remove-char-forward Control+d
rofication.notify.kb-delete-entry rofi kb-delete-entry (none)

The last three free Return, Delete and Shift+Delete from rofi's default bindings. A key must be bound to only one rofi action: if you pick a key that your rofi configuration already uses for another action (see rofi -dump-config), unbind it there. Example:

rofication.notify.kb-custom-1: Control+x
rofication.notify.kb-custom-2: Control+s,Return

CLI

This still needs to be written

About

Notification system that provides a Rofi front-end

Resources

Stars

27 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages