(â»ãã®å¾: -> hostごとにstatus lineの色を変える・改 - すぎゃーんメモ)
ãã¼ã«ã«ã¨ãsshãã°ã¤ã³ãã¦ãããµã¼ãã¨ããããiTermä¸ã®å¥ã¿ãã§éãã¦ããããtmuxèµ·åãã¦ãããã ãã© ã©ã®ã¿ããªã®ãããã«å¤å¥ã§ããªã status lineã®è²ãåãããããã°è¯ãã®ããª
ã¨ãããã¨ã§140æåhackã
ããã以ä¸ã®ããã«.zshrcã«æ¸ããã
if ! [ "$TMUX" = "" ]; then tmux set-option status-bg $(perl -MList::Util=sum -e'print+(red,green,blue,yellow,cyan,magenta,white)[sum(unpack"C*",shift)%7]' $(hostname)) | cat > /dev/null fi
ã·ã§ã«èµ·åæã«hostname
ããå¤å®ãã¦ã¹ãã¼ã¿ã¹ã©ã¤ã³ã®è²ãå¤ãããåºåçµæããã®ã¾ã¾/dev/null
ã«æ¨ã¦ããã¨ããã¨Linuxç°å¢ã§ãã³ã°ãããã°(ï¼)ãããã®ã§ãã¤ãã«æµãã¦åé¿ï½
ã©ã³ãã ã«æ¯åå¤ãã£ã¦ãã¾ãã®ã§ã¯ä¸ä¾¿ã ããç°å¢ããä¸æã«æ±ºã¾ãæ°åã§è²ã決ããããã®ä¾ã ã¨7種é¡ããé¸æè¢ããªãã®ã§éæªãåãã«ãªã£ã¦ãã¾ãã¨ã¢ã¬ã ãã©â¦ "colour0".."colour255"ã§é¸ã¶ã®ãå¾®å¦ã ããªãã
hostnameãªã©ã®æ
å ±ããããã·ã¥çã«ä¸æãªæ°åã決ããã®ã£ã¦ãã£ã¨è¯ãæ¹æ³ãªãã ãããï¼