fix #7 Most parameters of this plugin are configurable
This commit is contained in:
parent
ca5698634c
commit
237358425b
2 changed files with 25 additions and 5 deletions
11
README.md
11
README.md
|
@ -40,3 +40,14 @@ Once the aw-watcher-tmux plugin is installed it monitors for user activity in al
|
|||
aw-watcher-tmux creates a new bucket. The existence of this bucket can be checked with [http://localhost:5600/api/0/buckets/aw-watcher-tmux](http://localhost:5600/api/0/buckets/aw-watcher-tmux).
|
||||
|
||||
All activity recorded in this bucket can be seen on [http://localhost:5600/#/timeline](http://localhost:5600/#/timeline)
|
||||
|
||||
## Configuration
|
||||
|
||||
Many parameters of this plugin are configurable. For example to use `my.aw-server.test` as alternative aw host, add the following line to your `~/.tmux.conf`:
|
||||
|
||||
~~~tmux
|
||||
set -g @aw-watcher-tmux-host 'my.aw-server.test'
|
||||
~~~
|
||||
|
||||
For more options, please see `./scripts/monitor-session-activity.sh`
|
||||
|
||||
|
|
|
@ -1,19 +1,28 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
POLL_INTERVAL=10 # seconds
|
||||
get_tmux_option() {
|
||||
local option_value=$(tmux show-option -gqv "$1");
|
||||
echo ${option_value:-$2}
|
||||
}
|
||||
|
||||
######
|
||||
# Configurable options
|
||||
#
|
||||
# Usage examle:
|
||||
# set -g @aw-watcher-tmux-host 'my.aw-server.test'
|
||||
POLL_INTERVAL=$(get_tmux_option "@aw-watcher-tmux-poll-interval" 10) # seconds
|
||||
HOST=$(get_tmux_option "@aw-watcher-tmux-host" "localhost")
|
||||
PORT=$(get_tmux_option "@aw-watcher-tmux-port" "5600")
|
||||
PULSETIME=$(get_tmux_option "@aw-watcher-tmux-pulsetime" "120.0")
|
||||
|
||||
BUCKET_ID="aw-watcher-tmux"
|
||||
HOST="localhost"
|
||||
PORT="5600"
|
||||
API_URL="http://$HOST:$PORT/api"
|
||||
PULSETIME="120.0"
|
||||
|
||||
######
|
||||
# Related documentation:
|
||||
# * https://github.com/tmux/tmux/wiki/Formats
|
||||
# * https://github.com/tmux/tmux/wiki/Advanced-Use#user-content-getting-information
|
||||
#
|
||||
#
|
||||
|
||||
|
||||
### FUNCTIONS
|
||||
|
|
Loading…
Add table
Reference in a new issue