-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkeybtest.sh
executable file
·29 lines (27 loc) · 960 Bytes
/
keybtest.sh
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
#!/usr/bin/env bash
#
# Copyright (c) 2024-2025: [email protected]
# License: MIT
#
# Part of https://github.com/jaclu/tmux-keybtest
#
# Creates a tmux config for testing what keys can be used, then runs it.
#
# Not directly keyboard related, but since mouse-events also handle the same
# modifiers, it kind of makes sense to test it here. Enable with option: -m
#
# to kill any stray sessions: pkill -f ' \-L keybtest'
#
d_tkbtst_location="$(dirname "$(realpath "$0")")"
source "$d_tkbtst_location"/utils.sh
# Generate fresh tmux conf, to ensure it matches the installed version
"$d_tkbtst_location"/generate_tmux_conf.sh "$1" || {
echo "ERROR: generation of $tmux_conf failed!"
exit 1
}
#
# use pid of this script to make socket unique. This allows more than one
# terminal to run this at the same time independently.
#
# tmux -L keybtest-$$ -f "$d_tkbtst_location"/tmux-keybtest.conf
$TMUX_BIN -L keybtest-$$ -f "$tmux_conf"