diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
deleted file mode 100644
index 1609e73..0000000
--- a/.github/ISSUE_TEMPLATE/bug_report.md
+++ /dev/null
@@ -1,30 +0,0 @@
----
-name: Bug report
-about: Create a report to help us improve
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Describe the bug**
-A clear and concise description of what the bug is.
-
-**To Reproduce**
-Steps to reproduce the behavior:
-1. Go to '...'
-2. Click on '....'
-3. Scroll down to '....'
-4. See error
-
-**Expected behavior**
-A clear and concise description of what you expected to happen.
-
-**Screenshots**
-If applicable, add screenshots to help explain your problem.
-
-**Desktop (please complete the following information):**
- - OS: [e.g. iOS]
-
-**Additional context**
-Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 0000000..8468606
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,44 @@
+name: Bug report
+description: Create a report to help us improve.
+labels:
+ - "bug"
+body:
+ - type: textarea
+ attributes:
+ label: Describe the bug
+ description: A clear and concise description of what the bug is.
+ validations:
+ required: true
+ - type: textarea
+ id: repro
+ attributes:
+ label: Reproduction steps
+ description: "How do you trigger this bug? Please walk us through it step by step."
+ value: |
+ 1. Go to '...'
+ 2. Click on '....'
+ 3. Scroll down to '....'
+ 4. See error
+ - type: textarea
+ attributes:
+ label: Expected behaviour
+ description:
+ A clear and concise description of what you expected to happen.
+ - type: textarea
+ attributes:
+ label: Screenshots / Live demo link
+ description: If applicable, add screenshots to help explain your problem.
+ placeholder: Paste the github-readme-stats link as markdown image
+ - type: textarea
+ id: system
+ attributes:
+ label: System information
+ description: "Please complete the following information."
+ value: |
+ - OS: [e.g. Windows, Mac, Linux, iOS, android]
+ - Browser [e.g. chrome, safari, brave, firefox]
+ - Version [e.g. 22]
+ - type: textarea
+ attributes:
+ label: Additional context
+ description: Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 0000000..8321e8b
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: true
+contact_links:
+ - name: Question
+ url: https://github.com/rickstaa/tmux-notify/discussions
+ about: Please ask and answer questions here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
deleted file mode 100644
index bbcbbe7..0000000
--- a/.github/ISSUE_TEMPLATE/feature_request.md
+++ /dev/null
@@ -1,20 +0,0 @@
----
-name: Feature request
-about: Suggest an idea for this project
-title: ''
-labels: ''
-assignees: ''
-
----
-
-**Is your feature request related to a problem? Please describe.**
-A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
-
-**Describe the solution you'd like**
-A clear and concise description of what you want to happen.
-
-**Describe alternatives you've considered**
-A clear and concise description of any alternative solutions or features you've considered.
-
-**Additional context**
-Add any other context or screenshots about the feature request here.
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 0000000..fe3a4b3
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,28 @@
+name: Feature request
+description: Suggest an idea for this project.
+labels:
+ - "enhancement"
+body:
+ - type: textarea
+ attributes:
+ label: Is your feature request related to a problem? Please describe.
+ description:
+ A clear and concise description of what the problem is. Ex. I'm always
+ frustrated when [...]
+ validations:
+ required: true
+ - type: textarea
+ attributes:
+ label: Describe the solution you'd like
+ description: A clear and concise description of what you want to happen.
+ - type: textarea
+ attributes:
+ label: Describe alternatives you've considered
+ description:
+ A clear and concise description of any alternative solutions or features
+ you've considered.
+ - type: textarea
+ attributes:
+ label: Additional context
+ description:
+ Add any other context or screenshots about the feature request here.
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 0000000..790a122
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,59 @@
+name: release
+on:
+ push:
+ branches:
+ - main
+ tags:
+ - "v*.*.*"
+ pull_request:
+ types:
+ - labeled
+
+jobs:
+ release:
+ if: github.event.action != 'labeled'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ # Bump version on merging Pull Requests with specific labels.
+ # (bump:major,bump:minor,bump:patch)
+ - name: Bump version tag if tag bump label is found
+ id: bumpr
+ if: "!startsWith(github.ref, 'refs/tags/')"
+ uses: haya14busa/action-bumpr@v1
+
+ # Update corresponding major and minor tag.
+ # e.g. Update v1 and v1.2 when releasing v1.2.3
+ - name: Update major/minor tags
+ uses: haya14busa/action-update-semver@v1
+ if: "!steps.bumpr.outputs.skip"
+ with:
+ tag: ${{ steps.bumpr.outputs.next_version }}
+
+ # Get tag name.
+ - name: Get current tag
+ id: tag
+ uses: haya14busa/action-cond@v1
+ with:
+ cond: "${{ startsWith(github.ref, 'refs/tags/') }}"
+ if_true: ${{ github.ref }}
+ if_false: ${{ steps.bumpr.outputs.next_version }}
+
+ # Create release
+ - name: Release version
+ if: "steps.tag.outputs.value != ''"
+ env:
+ TAG_NAME: ${{ steps.tag.outputs.value }}
+ TAG_BODY: ${{ steps.bumpr.outputs.message }}
+ # This token is provided by Actions, you do not need to create your own token
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ run: |
+ gh release create ${TAG_NAME} -t "${TAG_NAME/refs\/tags\//}" --notes "${TAG_BODY}" --generate-notes
+ release-check:
+ if: github.event.action == 'labeled'
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+ - name: Post bumpr status comment
+ uses: haya14busa/action-bumpr@v1
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index a724cf0..0000000
--- a/CHANGELOG.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
-
-Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index fb2c9f2..5b8982c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -2,26 +2,26 @@
We love your input! 🚀 We want to make contributing to this project as easy and transparent as possible, whether it's:
-- Reporting a bug.
-- Discussing the current state of the code.
-- Submitting a fix.
-- Proposing new features.
+- [Reporting a bug](https://github.com/rickstaa/tmux-notify/issues/new?assignees=&labels=&projects=&template=bug_report.md&title=).
+- [Discussing the current state of the code](https://github.com/rickstaa/tmux-notify/discussions).
+- [Submitting a fix](https://github.com/rickstaa/tmux-notify/compare).
+- [Proposing new features](https://github.com/rickstaa/tmux-notify/issues/new?assignees=&labels=&projects=&template=feature_request.md&title=).
- Becoming a maintainer.
## We Develop with Github
-We use github to host code, to track issues and feature requests, as well as accept pull requests.
+We use github to host code, track issues and feature requests, and accept pull requests.
## We Use [Github Flow](https://guides.github.com/introduction/flow/index.html), So All Code Changes Happen Through Pull Requests
Pull requests are the best way to propose changes to the codebase (we use [Github Flow](https://docs.github.com/en/get-started/quickstart/github-flow)). We actively welcome your pull requests:
-1. Fork the repo and create your branch from `master`.
-2. If you've added code that should be tested, add tests.
-3. If you've changed APIs, update the documentation.
-4. Ensure the test suite passes.
-5. Make sure your code lints.
-6. Issue that pull request!
+1. Fork the repo and create your branch from `main`.
+2. Add tests if you've added code that should be tested.
+3. If you've changed APIs, update the documentation.
+4. Ensure the test suite passes.
+5. Make sure your code lints.
+6. Issue that pull request!
## Any contributions you make will be under the MIT Software License
@@ -33,14 +33,14 @@ We use GitHub issues to track public bugs. Report a bug by [opening a new issue]
## Write bug reports with detail, background, and sample code
-[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug report I wrote, and I think it's not a bad model. Here's [another example from Craig Hockenberry](http://www.openradar.me/11905408), an app developer whom I greatly respect.
+[This is an example](http://stackoverflow.com/q/12488905/180626) of a bug report, and I think it's a good model. Here's [another example from Craig Hockenberry](http://www.openradar.me/11905408), an app developer greatly respected in the community.
**Great Bug Reports** tend to have:
- A quick summary and/or background.
- Steps to reproduce:
- Be specific!
- - Give sample code if you can. [My stackoverflow question](http://stackoverflow.com/q/12488905/180626) includes sample code that _anyone_ with a base R setup can run to reproduce what I was seeing.
+ - Give sample code if you can. [This stackoverflow question](http://stackoverflow.com/q/12488905/180626) includes sample code that _anyone_ with a base R setup can run to reproduce what I was seeing.
- What you expected would happen.
- What actually happens.
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work).
diff --git a/README.md b/README.md
index 563d4dd..55478db 100644
--- a/README.md
+++ b/README.md
@@ -1,26 +1,54 @@
-# tmux-notify
+# tmux-notify
-[![Maintained](https://img.shields.io/badge/Maintained%3F-yes-green)](https://github.com/ChanderG/tmux-notify/pulse)
-[![Contributions](https://img.shields.io/badge/contributions-welcome-orange.svg)](contributing.md)
+[![Maintained](https://img.shields.io/badge/Maintained%3F-yes-green)](https://github.com/rickstaa/tmux-notify/pulse)
+[![Contributions](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md)
[![Tmux version](https://img.shields.io/badge/tmux-%3D%3E1.9-blue)](https://github.com/tmux/tmux/wiki)
-
+
Tmux plugin to notify you when processes are complete.
-Notifications are done via libnotify, and visual bells are raised in the tmux window. Visual bells can be mapped (in the terminal level) to X11 urgency bit and handled by your window manager.
+> **Note**
+> Notifications are sent via [libnotify](https://gitlab.gnome.org/GNOME/libnotify), and visual bells are raised in the Tmux window. Visual bells can be mapped (in the terminal level) to the X11 urgency bit and handled by your window manager.
+
+## Table of Contents
+
+* [Use cases](#use-cases)
+* [Pre-requisites](#pre-requisites)
+* [Install](#install)
+* [Usage](#usage)
+* [Configuration](#configuration)
+ * [Enable verbose notification](#enable-verbose-notification)
+ * [Change monitor update period](#change-monitor-update-period)
+ * [Add additional shell suffixes](#add-additional-shell-suffixes)
+ * [Enable telegram channel notifications](#enable-telegram-channel-notifications)
+* [How does it work](#how-does-it-work)
+* [Other use cases](#other-use-cases)
+ * [Use inside a docker container](#use-inside-a-docker-container)
+* [Contributing](#contributing)
+* [References](#references)
## Use cases
-- When you have already started a process in a pane and wish to be notified, that is when you can't use a manual trigger.
-- Working in different containers (Docker) -> can't choose the shell -> and can't use a shell-level feature
-- Working over ssh, but your Tmux is on the client-side
+* When you have already started a process in a pane and wish to be notified (i.e. you can't use a manual trigger).
+* Working in different containers (Docker) -> can't choose the shell -> and can't use a shell-level feature.
+* Working over ssh, but your Tmux is on the client side.
+
+## Pre-requisites
+
+* Bash
+* Tmux
+* `notify-send` or `osascript`.
+* **Optional**: `wget` (for telegram notifications).
+
+> **Note**
+> Works on Linux and macOS (note: only actively tested on Linux).
## Install
Using [Tmux Plugin Manager](https://github.com/tmux-plugins/tpm), add:
- set -g @plugin 'ChanderG/tmux-notify'
+ set -g @plugin 'rickstaa/tmux-notify'
to your `.tmux.conf`.
@@ -28,85 +56,96 @@ Use `prefix + I` to install.
## Usage
-- `prefix + m`: Start monitoring a pane and notify when it finishes.
-
-- `prefix + alt + m`: Start monitoring a pane, return it in focus and notify when it finishes.
+* `prefix + m`: Start monitoring a pane and notify when it finishes.
-- `prefix + M`: Cancel monitoring of a pane.
+* `prefix + alt + m`: Start monitoring a pane, return it in focus and notify when it finishes.
-## Pre-requisites
-
-- Bash
-- Tmux
-- `notify-send` or `osascript`.
-
-> **Note**
-> Works on Linux and macOS (note: only actively tested on Linux).
+* `prefix + M`: Cancel monitoring of a pane.
## Configuration
### Enable verbose notification
-The notification text is defaulted to `Tmux pane task completed!`. We have also included a verbose output option. Information about the pane, window, and session the task has completed is given when enabled.
+The default notification text is `Tmux pane task completed!`. This tool also contains a verbose output option which gives more information about the pane, window, and session the task has completed.
-To enable this, put `set -g @tnotify-verbose 'on'` in the `.tmux.conf` config file.
+> To enable this, put `set -g @tnotify-verbose 'on'` in the `.tmux.conf` config file.
#### Change the verbose notification message
To change the verbose notification text, put `set -g @tnotify-verbose-msg 'put your notification text here'` in the `.tmux.conf` config file. You can use all the Tmux variables in your notification text. Some useful Tmux aliases are:
-- `#D`: Pane id
-- `#P`: Pane index
-- `#T`: Pane title
-- `#S`: Session name
-- `#I`: Window index
-- `#W`: Window name
+* `#D`: Pane id
+* `#P`: Pane index
+* `#T`: Pane title
+* `#S`: Session name
+* `#I`: Window index
+* `#W`: Window name
For the complete list of aliases and variables, you are referred to the `FORMATS` section of the [tmux manual](http://man7.org/linux/man-pages/man1/tmux.1.html).
-### Enable telegram channel notifications
+### Change monitor update period
+
+By default, the monitor sleep period is set to 10 seconds. This means that tmux-notify checks the pane activity every 10 seconds.
+
+> Put `set -g @tnotify-sleep-duration 'desired duration'` in the `.tmux.conf` file to change this duration.
+
+> **Warning**
+> Remember that there is a trade-off between notification speed (short sleep duration) and the amount of memory this tool needs.
-By default, the notification is only sent to the operating system. We have also included a telegram channel notification option. When enabled, a notification is sent to a user-specified telegram channel.
+### Add additional shell suffixes
+
+The Tmux notify script uses your shell prompt suffix to check whether a command has finished. By default, it looks for the `$`, `#` and `%` suffixes.
-Put both `set -g @tnotify-telegram-bot-id 'your telegram bot id'` and `set -g @tnotify-telegram-channel-id 'your channel id'` in the `.tmux.conf` config file to enable this. Additionally, you can use the `set -g @tnotify-telegram-all 'on'` option to send all notifications to telegram. After enabling this option, the following key bindings are available:
+> Put `set -g @tnotify-prompt-suffixes 'put your comma-separated bash suffix list here'` in the `.tmux.conf` file to add additional suffixes.
-- `prefix + ctrl + M`: Start monitoring pane and notify in bash and telegram when it finishes.
+> **Note**
+> Feel free to open [a pull](https://github.com/rickstaa/tmux-notify/pulls) request or [issue](https://github.com/rickstaa/tmux-notify/issues) if you think your shell prompt suffix should be included by default.
-- `prefix + ctrl + alt + M`: Start monitoring a pane, return it in focus and notify in bash and telegram when it finishes.
+### Enable telegram channel notifications
> **Warning**
> This feature requires [wget](https://www.gnu.org/software/wget/) to be installed on your system.
-> **Note**
-> You can get your telegram bot id by creating a bot using [BotFather](https://core.telegram.org/bots#6-botfather) and your channel id by sending your channel invite link to the `@username_to_id_bot` bot.
+By default, the tool only sent operating system notifications. It can, however, also send a message to a user-specified telegram channel.
-### Change monitor update period
+> Put `set -g @tnotify-telegram-bot-id 'your telegram bot id'` and `set -g @tnotify-telegram-channel-id 'your channel id'` in the `.tmux.conf` config file to enable this.
-By default, the monitor sleep period is set to 10 seconds. This means that tmux-notify checks the pane activity every 10 seconds.
+After enabling this option, the following key bindings are available:
-Put `set -g @tnotify-sleep-duration 'desired duration'` in the `.tmux.conf` file to change this duration.
+* `prefix + ctrl + m`: Start monitoring pane and notify in bash and telegram when it finishes.
-> **Warning**
-> Remember that there is a trade-off between notification speed (short sleep duration) and the amount of memory this tool needs.
+* `prefix + ctrl + alt + m`: Start monitoring a pane, return it in focus and notify in bash and telegram when it finishes.
-### Add additional shell suffixes
+Additionally, you can use the `set -g @tnotify-telegram-all 'on'` option to send all notifications to telegram.
-The Tmux notify script uses your shell prompt suffix to check whether a command has finished. By default, it looks for the `$`, `#` and `%` suffixes. If you customise your shell to use different shell suffixes, you can add them by putting `set -g @tnotify-prompt-suffixes 'put your comma-separated bash suffix list here'` in the `.tmux.conf` file.
+> **Note**
+> You can get your telegram bot id by creating a bot using [BotFather](https://core.telegram.org/bots#6-botfather) and your channel id by sending your channel invite link to the `@username_to_id_bot` bot.
+
+### Execute custom notification commands
+
+You can execute a custom command after a process has finished by putting `set -g @tnotify-custom-cmd 'your custom command here'` in the `.tmux.conf` file. The custom command is executed in the pane where the process has finished. If you want to execute multiple commands, you can also put them in a bash script and execute this script (i.e. `set -g @tnotify-custom-cmd 'bash /path/to/script.sh'`).
+
+> **Warning**
+> The custom command is executed using the `eval` command, so [be careful with what you put in here](https://stackoverflow.com/a/17529221/8135687).
-Feel free to open [a pull](https://github.com/ChanderG/tmux-notify/pulls) request or [issue](https://github.com/ChanderG/tmux-notify/issues) if you think your shell prompt suffix should be included by default.
+> **Note**
+> Please consider contributing to [this repository](https://github.com/rickstaa/tmux-notify) if your custom command is useful for others.
## How does it work
-The pretty naive approach. Checks if pane content ends with the bash prompt suffixes mentioned above every 10 seconds.
+A naive approach. Checks if pane content ends with the bash prompt suffixes mentioned above every 10 seconds.
-## Contributing
+## Other use cases
-Feel free to open an issue if you have ideas on how to make this GitHub action better or if you want to report a bug! All contributions are welcome. :rocket: Please consult the [contribution guidelines](CONTRIBUTING.md) for more information.
+### Use inside a docker container
-## License
+Because tmux-notify uses [libnotify](https://gitlab.gnome.org/GNOME/libnotify) to send notifications, it needs access to the host's D-Bus socket. An excellent guide on how to do this can be found [here](https://github.com/mviereck/x11docker/wiki/How-to-connect-container-to-DBus-from-host#dbus-user-session-daemon). You can also check out the [examples/docker](examples/docker/README.md) folder for an example.
+
+## Contributing
-[MIT](LICENSE)
+Feel free to open an issue if you have ideas on how to make this GitHub action better or if you want to report a bug! All contributions are welcome :rocket:. Please consult the [contribution guidelines](CONTRIBUTING.md) for more information.
## References
-Icon created with svg made by [@chanut](https://www.flaticon.com/authors/chanut) from [www.flaticon.com](https://www.flaticon.com/authors/chanut)
+* This repository is a **detached fork** from the https://github.com/ChanderG/tmux-notify repository. It was detached because the original repository is no longer maintained.
+* Icon created with svg made by [@chanut](https://www.flaticon.com/authors/chanut) from [www.flaticon.com](https://www.flaticon.com/authors/chanut)
diff --git a/examples/README.md b/examples/README.md
new file mode 100644
index 0000000..56eafe4
--- /dev/null
+++ b/examples/README.md
@@ -0,0 +1,5 @@
+# Examples
+
+This folder contains several examples on how to use tmux-notify in different scenarios:
+
+- ``docker``: A simple example on how to make tmux-notify work inside a docker container.
diff --git a/examples/docker/Dockerfile b/examples/docker/Dockerfile
new file mode 100644
index 0000000..3bf4099
--- /dev/null
+++ b/examples/docker/Dockerfile
@@ -0,0 +1,11 @@
+# A small Dockerfile to build a container in which tmux-notify can be tested.
+FROM ubuntu:latest
+
+# Install required packages.
+RUN apt-get update
+RUN apt-get upgrade -y
+RUN apt-get install -y \
+ libnotify-bin \
+ dbus \
+ tmux \
+ git
diff --git a/examples/docker/README.md b/examples/docker/README.md
new file mode 100644
index 0000000..91dc992
--- /dev/null
+++ b/examples/docker/README.md
@@ -0,0 +1,9 @@
+# Docker example
+
+This example shows how to make tmux-notify work inside a docker container. You can test it out by executing the following inside your terminal:
+
+```bash
+bash docker_test.sh
+```
+
+This command will open a Tmux session inside a docker container, and if you have installed [tmp](https://github.com/tmux-plugins/tpm) and [tmux-notify](https://github.com/rickstaa/tmux-notify), on your host machine you should be able to use [tmux-notify](https://github.com/rickstaa/tmux-notify) as usual. For more information on how this works, see [this guide](https://github.com/mviereck/x11docker/wiki/How-to-connect-container-to-DBus-from-host#dbus-user-session-daemon).
diff --git a/examples/docker/docker-compose.yml b/examples/docker/docker-compose.yml
new file mode 100644
index 0000000..8ec6d00
--- /dev/null
+++ b/examples/docker/docker-compose.yml
@@ -0,0 +1,17 @@
+version: "3"
+services:
+ app:
+ image: tmux-notify-test:latest
+ build: .
+ environment:
+ - DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus # Replace with your user id.
+ security_opt:
+ - apparmor:unconfined
+ volumes:
+ - /run/user/1000/bus:/run/user/1000/bus # Replace with your user id.
+ - /etc/group:/etc/group:ro
+ - /etc/passwd:/etc/passwd:ro
+ - $HOME/.tmux:$HOME/.tmux # Your tmux folder.
+ - $HOME/.tmux.conf:$HOME/.tmux.conf # Your tmux config.
+ - $HOME/.tmux.conf.local:$HOME/.tmux.conf.local # Your tmux local config.
+ user: 1000:1000 # Replace with your user / group id.
diff --git a/examples/docker/docker_test.bash b/examples/docker/docker_test.bash
new file mode 100644
index 0000000..fb9c28c
--- /dev/null
+++ b/examples/docker/docker_test.bash
@@ -0,0 +1,12 @@
+# Command line example with all parameters needed to run tmux-notify inside a docker container.
+docker build -t tmux-notify-docker-test:latest .
+docker run -e DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus \
+-v /run/user/1000/bus:/run/user/1000/bus \
+-v /etc/group:/etc/group:ro \
+-v /etc/passwd:/etc/passwd:ro \
+-v $HOME/.tmux:$HOME/.tmux \
+-v $HOME/.tmux.conf:$HOME/.tmux.conf \
+-v $HOME/.tmux.conf.local:$HOME/.tmux.conf.local \
+--security-opt apparmor=unconfined \
+-u $(id -u):$(id -g) \
+-it tmux-notify-docker-test:latest tmux
diff --git a/scripts/notify.sh b/scripts/notify.sh
index 6254121..44d1ca9 100755
--- a/scripts/notify.sh
+++ b/scripts/notify.sh
@@ -78,10 +78,17 @@ if [[ ! -f "$PID_FILE_PATH" ]]; then # If pane not yet monitored
sleep "$monitor_sleep_duration_value"
done
- # job done - remove pid file and return
+ # job done - remove pid file
if [[ -f "$PID_FILE_PATH" ]]; then
rm "$PID_FILE_PATH"
fi
+
+ # Execute custom command if specified by user
+ custom_command="$(get_tmux_option "$custom_notify_command" "$custom_notify_command_default")"
+ if [[ -n "$custom_command" ]]; then
+ eval "${custom_command}"
+ fi
+
exit 0
else # If pane is already being monitored
diff --git a/scripts/variables.sh b/scripts/variables.sh
index 1c5f3a5..c5eab22 100644
--- a/scripts/variables.sh
+++ b/scripts/variables.sh
@@ -17,6 +17,8 @@ export PID_FILE_PATH="${PID_DIR}/${PANE_ID}.pid"
## Tnotify tmux options
export prompt_suffixes="@tnotify-prompt-suffixes"
export prompt_suffixes_default="$,#,%"
+export custom_notify_command="@tnotify-custom-cmd"
+export custom_notify_command_default="bash ~/Desktop/test.bash"
# Notification verbosity settings
export verbose_option="@tnotify-verbose"