[PR #344] [MERGED] Notifications #1052

Closed
opened 2026-03-15 11:16:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/asciinema/asciinema/pull/344
Author: @ku1ik
Created: 3/30/2019
Status: Merged
Merged: 9/8/2019
Merged by: @ku1ik

Base: developHead: feature/notifications


📝 Commits (7)

  • 79bdfaf Fix double quote escaping in AppleScript notifier
  • 8321b69 Add libnotify notifier
  • 4e66afc Add terminal-notifier support
  • 81cf7c1 Use icon with send-notify and terminal-notifier
  • 3a7c1a6 Custom notification command + disabling notifications
  • a9f9d8f Ignore empty ("") custom notification command
  • 788cc48 Explain env var in custom notification command

📊 Changes

8 files changed (+107 additions, -15 deletions)

View changed files

📝 README.md (+9 -0)
📝 asciinema/commands/record.py (+4 -1)
📝 asciinema/config.py (+8 -0)
asciinema/data/icon-256x256.png (+0 -0)
📝 asciinema/notifier.py (+60 -8)
📝 asciinema/recorder.py (+6 -6)
📝 setup.py (+1 -0)
📝 tests/config_test.py (+19 -0)

📄 Description

#340 and #341 added new features that are triggered via key bindings and we should have ability to show a notification that these actions (recording pause, adding a breakpoint) have actually been executed. Without some kind of notification you would never be sure if that worked.

Printing something to the terminal is not a good idea here, since it would potentially overwrite whatever was printed before (in fullscreen apps like vim), so I believe an external tool is the best choice (at least by default).

To have a good out-of-the-box experience we could lean on executing desktop notification utility, like notify-send (Linux/libnotify), kdialog (Linux/KDE), osascript -e 'display notification ..' (macOS), growlnotify (macOS) etc.

The command to use can be auto-detected, like here for example: https://github.com/sickill/git-dude/blob/master/git-dude#L18-L30

Then, a setting in a config file could be supported, sth like notification_command, which would allow overriding auto-detection, and specifying a command to invoke to notify about pause/resume/setting breakpoint/etc. One could then for example play a sound or show the notification in tmux's status bar (via tmux display-message).

Some part of this was already implemented in #340 (merged).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/asciinema/asciinema/pull/344 **Author:** [@ku1ik](https://github.com/ku1ik) **Created:** 3/30/2019 **Status:** ✅ Merged **Merged:** 9/8/2019 **Merged by:** [@ku1ik](https://github.com/ku1ik) **Base:** `develop` ← **Head:** `feature/notifications` --- ### 📝 Commits (7) - [`79bdfaf`](https://github.com/asciinema/asciinema/commit/79bdfaf37ec06faad340a36eaa0e6408617ebf76) Fix double quote escaping in AppleScript notifier - [`8321b69`](https://github.com/asciinema/asciinema/commit/8321b69b2927168ddaf87a1b0d292f2ae06be2bc) Add libnotify notifier - [`4e66afc`](https://github.com/asciinema/asciinema/commit/4e66afc71c0483f335c9093a9ac0ac8126e14845) Add terminal-notifier support - [`81cf7c1`](https://github.com/asciinema/asciinema/commit/81cf7c15232da07d2eae637f0dfd24a7721df85c) Use icon with send-notify and terminal-notifier - [`3a7c1a6`](https://github.com/asciinema/asciinema/commit/3a7c1a6e33ad0572a834b57739adb89a3450a75d) Custom notification command + disabling notifications - [`a9f9d8f`](https://github.com/asciinema/asciinema/commit/a9f9d8fb412fd467c1cbde17a496fcc851b6cbe9) Ignore empty ("") custom notification command - [`788cc48`](https://github.com/asciinema/asciinema/commit/788cc488f109fcf0099fcbeedd6eca6b023398fd) Explain env var in custom notification command ### 📊 Changes **8 files changed** (+107 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `README.md` (+9 -0) 📝 `asciinema/commands/record.py` (+4 -1) 📝 `asciinema/config.py` (+8 -0) ➕ `asciinema/data/icon-256x256.png` (+0 -0) 📝 `asciinema/notifier.py` (+60 -8) 📝 `asciinema/recorder.py` (+6 -6) 📝 `setup.py` (+1 -0) 📝 `tests/config_test.py` (+19 -0) </details> ### 📄 Description #340 and #341 added new features that are triggered via key bindings and we should have ability to show a notification that these actions (recording pause, adding a breakpoint) have actually been executed. Without some kind of notification you would never be sure if that worked. Printing something to the terminal is not a good idea here, since it would potentially overwrite whatever was printed before (in fullscreen apps like vim), so I believe an external tool is the best choice (at least by default). To have a good out-of-the-box experience we could lean on executing desktop notification utility, like `notify-send` (Linux/libnotify), `kdialog` (Linux/KDE), `osascript -e 'display notification ..'` (macOS), `growlnotify` (macOS) etc. The command to use can be auto-detected, like here for example: https://github.com/sickill/git-dude/blob/master/git-dude#L18-L30 Then, a setting in a config file could be supported, sth like `notification_command`, which would allow overriding auto-detection, and specifying a command to invoke to notify about pause/resume/setting breakpoint/etc. One could then for example play a sound or show the notification in tmux's status bar (via tmux `display-message`). Some part of this was already implemented in #340 (merged). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-15 11:16:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/asciinema#1052
No description provided.