aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2022-04-30 20:06:00 +0900
committernsfisis <nsfisis@gmail.com>2022-04-30 20:06:00 +0900
commit49b51fa7b74a76a3e8a9803cd57b68627adc83ad (patch)
treecd0f96f36a2706fa7a16dd6ffd1899d3045970ec
parent6b428249eb25e1cdbca3284b4edc0e5629f2befe (diff)
downloaddotfiles-49b51fa7b74a76a3e8a9803cd57b68627adc83ad.tar.gz
dotfiles-49b51fa7b74a76a3e8a9803cd57b68627adc83ad.tar.zst
dotfiles-49b51fa7b74a76a3e8a9803cd57b68627adc83ad.zip
bin: add tmux-pane-idx
-rwxr-xr-xbin/tmux-pane-idx4
-rwxr-xr-xsetup.sh15
2 files changed, 19 insertions, 0 deletions
diff --git a/bin/tmux-pane-idx b/bin/tmux-pane-idx
new file mode 100755
index 0000000..7da534f
--- /dev/null
+++ b/bin/tmux-pane-idx
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+# Prints the tmux pane index.
+tmux display -pt "${TMUX_PANE:?}" '#{pane_index}'
diff --git a/setup.sh b/setup.sh
index 5ab7548..e8ad667 100755
--- a/setup.sh
+++ b/setup.sh
@@ -58,3 +58,18 @@ if [ ! -f ~/.config/skk/jisyo.L ]; then
curl -fL -o "$_compressed_jisyo" https://skk-dev.github.io/dict/SKK-JISYO.L.unannotated.gz
gunzip -cd "$_compressed_jisyo" > ~/.config/skk/jisyo.L
fi
+
+if [ ! -d ~/bin ]; then
+ echo "dir: ~/bin"
+ mkdir ~/bin
+fi
+
+for name in \
+ tmux-pane-idx \
+ ; \
+do
+ if [ ! -L ~/bin/"$name" ]; then
+ echo "symlink: ~/bin/$name"
+ ln -s -f ~/dotfiles/bin/"$name" ~/bin/"$name"
+ fi
+done