一半君的总结纸

听话只听一半君

在CentOS / Synology NAS 上安装配置tmux 1.9a

ipkg install tmux 装出来是1.6,我想用最新的1.9

用和 CentOS 6.4 无root statically compile tmux 1.9a 同样的方法装
结果configure libevent的时候提示

configure: error: no acceptable C compiler found in $PATH

原来默认没有compiler,所以

DiskStation> ipkg install gcc
Installing gcc (4.2.3-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/gcc_4.2.3-1_arm.ipk
Installing binutils (2.19.1-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/binutils_2.19.1-1_arm.ipk
Installing libc-dev (2.5-5) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libc-dev_2.5-5_arm.ipk
Installing libnsl (2.5-4) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libnsl_2.5-4_arm.ipk
Configuring binutils
update-alternatives: Linking //opt/bin/strings to /opt/bin/binutils-strings
Configuring gcc
Configuring libc-dev
Configuring libnsl
Successfully terminated.

# 还需要
DiskStation> ipkg install make
Installing make (3.82-1) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/make_3.82-1_arm.ipk
Configuring make
Successfully terminated.

# 可能还需要
DiskStation> ipkg install libstdc++
Installing libstdc++ (6.0.9-6) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/libstdc++_6.0.9-6_arm.ipk
Configuring libstdc++
Successfully terminated.

之后再照同样方法安装即可

世界和谐了…

DiskStation> tmux -V
tmux 1.9a

继续安装powerline(新的Python版),官方步骤在此

我想要system wide install, 所以tmux配置文件放在 /etc/tmux.conf

  1. 首先pip 装 git clone 下来的最新版 (去掉 –user)
    pip install git+git://github.com/Lokaltog/powerline
    
  2. tmux.conf里加上最后一行
    unbind C-b
    set -g prefix C-a
    set-option -g default-terminal "screen-256color"
    
    set-window-option -g mode-keys vi
    
    source '/usr/local/packages/@appstore/Python/usr/local/lib/python2.7/site-packages/powerline/bindings/tmux/powerline.conf'
    
  3. 解决字体patch问题
    没有fontconfig,我先装一个

    DiskStation> ipkg install fontconfig
    Installing fontconfig (2.8.0-0) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/fontconfig_2.8.0-0_arm.ipk
    Installing expat (2.0.1-1) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/expat_2.0.1-1_arm.ipk
    Installing freetype (2.3.6-1) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/freetype_2.3.6-1_arm.ipk
    Installing zlib (1.2.5-1) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/zlib_1.2.5-1_arm.ipk
    Installing gconv-modules (2.5-1) to root...
    Downloading http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/gconv-modules_2.5-1_arm.ipk
    Configuring expat
    Configuring fontconfig
    Configuring freetype
    Configuring gconv-modules
    Configuring zlib
    Successfully terminated.
    

    # 本来想按下面方法装字体,但是synology没有这个目录,不知道该往哪里放,请高手指点

    # 去<a href="https://github.com/Lokaltog/powerline-fonts" target="_blank">这里</a>挑一个字体,比如
    curl https://github.com/Lokaltog/powerline-fonts/raw/master/Inconsolata/Inconsolata%20for%20Powerline.otf -o Inconsolata_for_powerline.otf
    
    sudo mv Inconsolata_for_powerline.otf /usr/share/fonts/
    sudo fc-cache -vf
    

    因为我是在windows下的cygwin窗口里ssh去NAS,所以字体应该装在windows里,所以下载个patch过后的字体复制到c:\windows\fonts下,然后重新打开cygwin,选择字体为该字体即可
    之前
    synology_tmux
    之后
    powerline_working

pss: 在公司的CentOS上装了1.9a之后,似乎powerline的箭头显示还是不正确,直到用下面这行开tmux才可以

tmux -2

此外某些section的右侧似乎被下一个section挡住了,试了半天,最终由github某位高人指点改好了,主要是在default theme的配置文件 default.json 里相应section里加了 “right”:” ” ,其实就是右侧多加个空格 …(其实doc里写了,我没仔细看)
改过之后是这样:

{
	"default_module": "powerline.segments.common",
	"segment_data": {
		"uptime": {
			"before": "⇑  ",
			"after": " "
		},
		"date": {
			"before": "⌚ "
		}
	},
	"segments": {
		"right": [
			{
				"name": "uptime",
				"priority": 50
			},
			{
				"name": "system_load",
				"priority": 50
			},
			{
				"name": "date",
				"after":" "
			},
			
			{
				"name": "date",
				"args": {
					"format": "%H:%M",
					"istime": true
				},
				"after":" "
				
			},
			{
				"name": "hostname"
			}
		]
	}
}

最终效果(CentOS的):
tmux8

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 更改 )

Twitter picture

You are commenting using your Twitter account. Log Out / 更改 )

Facebook photo

You are commenting using your Facebook account. Log Out / 更改 )

Google+ photo

You are commenting using your Google+ account. Log Out / 更改 )

Connecting to %s

%d 博主赞过: