-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathtnotify.tmux
executable file
·33 lines (27 loc) · 900 Bytes
/
tnotify.tmux
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
# Get current directory
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Set PID_DIR
if [[ -z $XDG_CACHE_HOME ]]; then
export PID_DIR=~/.tmux/notify
else
export PID_DIR="$XDG_CACHE_HOME/tmux/tmux-notify"
fi
# Initialize variables
source "$CURRENT_DIR/scripts/helpers.sh"
source "$CURRENT_DIR/scripts/variables.sh"
# prepare pid file directory
if [[ ! -d $PID_DIR ]]; then
mkdir $PID_DIR
fi
# Bind plugin keys
tmux unbind-key m
tmux unbind-key M
tmux unbind-key M-m
tmux unbind-key C-m
tmux unbind-key C-M-m
tmux bind-key m run-shell -b "$CURRENT_DIR/scripts/notify.sh"
tmux bind-key M run-shell -b "$CURRENT_DIR/scripts/cancel.sh"
tmux bind-key M-m run-shell -b "$CURRENT_DIR/scripts/notify.sh true"
tmux bind-key C-m run-shell -b "$CURRENT_DIR/scripts/notify.sh false true"
tmux bind-key C-M-m run-shell -b "$CURRENT_DIR/scripts/notify.sh true true"