我想tmux
根据机器的主机名动态选择颜色。由于我tmux.conf
在多台机器上共享我的,因此为这些主机中的每一个分配独特的颜色在视觉上会很方便,尤其是在同时处理多个主机时。这是可行的吗?
小智 3
我也想要这个功能。\xc2\xa0\n我\xc2\xa0基本上将所有内容合并到此中.tmux.conf
# cat <<__DATA__ >/dev/null\n# Embed shell scripts\n\nset -g status-utf8 on\nset -g utf8 on\n\nset -g default-terminal "screen-256color"\n\nrun "cut -c3- ~/.tmux.conf | bash -s apply_configuration"\n\n# __DATA__\n#\n# apply_configuration() {\n# tmux set -g status-bg colour$(hash_string256 $(hostname))\n# }\n# hash_string256() {\n# hash_value=$(printf "%s" "$1" | md5sum | sed -e 's/[^[:alnum:]]\\+//g' | tr "a-f" "A-F")\n# if [ "x" != "x$2" ]\n# then\n# v2="+ $2"\n# fi\n# echo "$(((0x$hash_value $v2) % 255))" | tr -d "-"\n# }\n# \n# $1\n
Run Code Online (Sandbox Code Playgroud)\n我删除了 using bc
,因为我的 git-bash 中没有它。 \xc2\xa0\n因此 \xc2\xa0I\xc2\xa0 希望它能够在我的 Linux 系统 \n 和 \xc2\xa0Windows 上使用 Cygwin 运行,而无需添加额外的东西。
归档时间: |
|
查看次数: |
3679 次 |
最近记录: |