#! /bin/bash
layout=$(~/Dropbox/Script/im-select)
if [[ $layout == *"pinyin"* ]];then
echo "🇨🇳"
elif [[ $layout == *'US'* ]];then
echo "🇺🇸"
fi
最后在 tmux 的配置文件中做一点微小的工作,在需要显示输入法状态的地方加上"#(~/Dropbox/Script/tmux-show-im.sh)"即可,比如:
set-option -g status-right "#(~/Dropbox/Script/tmux-show-im.sh)"
tmux 状态栏默认的刷新间隔是 15 秒,可以改小点,如改为一秒:
set-option -g status-interval 1
