-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds an example on how tmux-notify can be used within a docker container.
- Loading branch information
Showing
6 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |