2010年5月25日星期二

Xu Hui Hui's blog » Archive » i3 & urxvt

Xu Hui Hui's blog » Archive » i3 & urxvt

i3 & urxvt

After trying several Tiling Window Managers with Linux (awesome, dwm, wmii, musca), I installed i3 yesterday, with which I’m pretty satisfied.

“awesome” is a very full-featured window manager in the list, with features like status panel built inside. The most noticeable thing should be the author’s rapid development on it, usually resulting out big changes on the configuration file for the users. However, it’s not a big deal for geeks who’re really love the wm (Window Manager).

“dwm” is the most slim software I’ve ever known: a very usable wm with less than 2000 lines of code. Due to this simplicity, the configuration thing is just altering the source of it and then recompile. GEEK enough ;) I once tried it also on Opensolaris and it worked pretty good too. Also because of being too simple, it’s not as featured as other wm, e.g. the it has limited kinds of layout.

Then I switched to “wmii”, which is developed by the same authors of “dwm”. The first thing to note is that wmii has title bar for windows (though not Chinese-characters-friendly by default). My favorite feature of wmii is it’s auto-hide workspaces: workspaces are created when you start to use them, and would disappear automatically if no windows there.

After that I tried “musca”, which is manual-layout (all the ones mentioned above are auto-layout), meaning that the wm doesn’t choose a default layout for you, instead, you create the layout by hand and place which windows in which part of the layout. The most unhappy thing is the lack of the auto-hide workspaces like in wmii. Actually I simulated it by key-binding configurations, however, it’s not as good, and also is a overhead.

As an improvement to wmii which I kept for not a short time, it feels like home to work with i3, though the default key bindings of “j k l ;” might be strange to Vim uses like me, which doesn’t matter much since they are fully configurable. I changed them to “h j k l”, and use “i” to replace the default “h” to change to the vertical-tabs layout. The full configuration will be listed below (~/.i3/config).

Here is a screenshot

i3 and urxvt in archlinux

i3 and urxvt in archlinux

Configuration file: ~/.i3/config. For the latest version, check
http://github.com/cooky/dotfiles_archlinux/blob/master/.i3/config

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File: ~/.i3/config
# xhh's config of i3 (a tilling window manager)
# For the latest version, check:
# http://github.com/cooky/dotfiles_archlinux/blob/master/.i3/config

# This configuration uses Mod1 and Mod4. Make sure they are mapped properly using xev(1)
# and xmodmap(1). Usually, Mod1 is Alt (Alt_L) and Mod4 is Windows (Super_L)

terminal /usr/bin/urxvt

# ISO 10646 = Unicode
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1

# No window titles. Keep the border (values: bn, bp, bb)
new_window bp

# Key bindings below

# Use Mouse+Mod1 to drag floating windows to their wanted position
floating_modifier Mod1

# Fullscreen (Mod4+f)
bind Mod4+41 f

# Switch to Stacking layout (vertical tab) (Mod4+i)
bind Mod4+31 s

# Switch to Tabbed layout (horizontal tag) (Mod4+p)
bind Mod4+33 T

# Switch to Default layout (Mod4+e)
bind Mod4+26 d

# Toggle tiling/floating of the current window (Mod4+Shift+Space)
bind Mod4+Shift+65 t

# Go into the tiling layer / floating layer, depending on whether
# the current window is tiling / floating (Mod4+o)
bind Mod4+32 focus ft

# Focus the window left/down/up/right (Mod4+h/j/k/l)
bind Mod4+43 h
bind Mod4+44 j
bind Mod4+45 k
bind Mod4+46 l
# (alternatively, you can use the cursor keys:)
bindsym Mod4+Left h
bindsym Mod4+Down j
bindsym Mod4+Up k
bindsym Mod4+Right l

# Focus Container (Mod1+h/j/k/l)
bind Mod1+43 wch
bind Mod1+44 wcj
bind Mod1+45 wck
bind Mod1+46 wcl

# Snap (Mod1+Control+h/j/k/l)
bind Mod1+Control+43 sh
bind Mod1+Control+44 sj
bind Mod1+Control+45 sk
bind Mod1+Control+46 sl
# (alternatively, you can use the cursor keys:)
bindsym Mod4+Control+Left h
bindsym Mod4+Control+Down j
bindsym Mod4+Control+Up k
bindsym Mod4+Control+Right l

# Move (Mod4+Shift+h/j/k/l)
bind Mod4+Shift+43 mh
bind Mod4+Shift+44 mj
bind Mod4+Shift+45 mk
bind Mod4+Shift+46 ml
# (alternatively, you can use the cursor keys:)
bindsym Mod4+Shift+Left h
bindsym Mod4+Shift+Down j
bindsym Mod4+Shift+Up k
bindsym Mod4+Shift+Right l

# Move Container (Mod4+Shift+h/j/k/l)
bind Mod4+Shift+43 wcmh
bind Mod4+Shift+44 wcmj
bind Mod4+Shift+45 wcmk
bind Mod4+Shift+46 wcml

# Workspaces (Mod4+1/2/…)
bind Mod4+10 1
bind Mod4+11 2
bind Mod4+12 3
bind Mod4+13 4
bind Mod4+14 5
bind Mod4+15 6
bind Mod4+16 7
bind Mod4+17 8
bind Mod4+18 9
bind Mod4+19 10

# Move to Workspaces
bind Mod4+Shift+10 m1
bind Mod4+Shift+11 m2
bind Mod4+Shift+12 m3
bind Mod4+Shift+13 m4
bind Mod4+Shift+14 m5
bind Mod4+Shift+15 m6
bind Mod4+Shift+16 m7
bind Mod4+Shift+17 m8
bind Mod4+Shift+18 m9
bind Mod4+Shift+19 m10

# Mod4+n starts a new terminal: urxvt
bind Mod4+57 exec /usr/bin/urxvt

# Mod4+c kills the current client
bind Mod4+54 kill

# Mod4+m starts dmenu and launches the selected application
# for now, we don’t have an own launcher
bind Mod4+58 exec /usr/bin/dmenu_run

# Mod4+Shift+e exits i3
bind Mod4+Shift+26 exit

# Mod4+Shift+r restarts i3 inplace
bind Mod4+Shift+27 restart

Here is my .Xdefaults, where you can find config for urxvt (rxvt-unicode) e.g. transparency setting

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
! ~/.Xdefaults
! xhh config for terminals e.g. urxvt
! For the latest version, check
! http://github.com/cooky/dotfiles_archlinux/blob/master/.Xdefaults

! normal settings
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
! terminal color scheme
*foreground: rgb:dd/dd/dd
*background: rgb:22/22/22
!black
*color0: rgb:19/19/19
*color8: rgb:25/25/25
!red
*color1: rgb:80/32/32
*color9: rgb:98/2b/2b
!green
*color2: rgb:5b/76/2f
*color10: rgb:89/b8/3f
!brown/yellow
*color3: rgb:aa/99/43
*color11: rgb:ef/ef/60
!blue
*color4: rgb:32/4c/80
*color12: rgb:2b/4f/98
!magenta
*color5: rgb:70/6c/9a
*color13: rgb:82/6a/b1
!cyan
*color6: rgb:92/b1/9e
*color14: rgb:a1/cd/cd
!white
*color7: rgb:ff/ff/ff
*color15: rgb:dd/dd/dd

! urxvt settings
! transparency settings
URxvt.inheritPixmap: true
URxvt.transparent: true
URxvt.tintColor: #000
URxvt.shading: 45
! other settings
URxvt.geometry: 90x25+180+200
URxvt.cursorColor:red3
URxvt.scrollBar:False
URxvt.saveLines:3000
URxvt.preeditType:Root
! open URL in browser
URxvt.urlLauncher: google-chrome
URxvt.matcher.button: 1
URxvt.perl-ext-common: matcher
! normal font
!URxvt.font:xft:YaHei Consolas Hybrid:pixelsize=14:antialias=true,xft:Droid Sans Fallback:pixelsize=12:antialias=true
!URxvt.font:xft:Bitstream Vera Sans Mono:pixelsize=13:antialias=true,xft:Droid Sans Fallback:pixelsize=12:antialias=true
!URxvt.font:xft:DejaVu Sans Mono:pixelsize=13:antialias=true,xft:Droid Sans Fallback:pixelsize=12:antialias=true
URxvt.font:xft:Monaco:pixelsize=13:antialias=true,xft:WenQuanYi Micro Hei Mono:pixelsize=13:antialias=true
!URxvt.font:xft:ProFont:pixelsize=13:antialias=true,xft:WenQuanYi ZenHei:pixelsize=15:antialias=true
! bold font
!URxvt.boldFont:xft:YaHei Consolas Hybrid:pixelsize=14:Bold:antialias=true,xft:Droid Sans Fallback:pixelsize=12:Bold:antialias=true
!URxvt.boldFont:xft:Bitstream Vera Sans Mono:pixelsize=13:Bold:antialias=true,xft:Droid Sans Fallback:pixelsize=12:Bold:antialias=true
!URxvt.boldFont:xft:DejaVu Sans Mono:pixelsize=13:Bold:antialias=true,xft:Droid Sans Fallback:pixelsize=12:Bold:antialias=true
URxvt.boldFont:xft:Monaco:pixelsize=13:Bold:antialias=true,xft:WenQuanYi Micro Hei Mono:pixelsize=13:Bold:antialias=true
!URxvt.boldFont:xft:ProFont:pixelsize=13:antialias=true,xft:WenQuanYi ZenHei:pixelsize=15:antialias=true

Finally, my ~/.xinitrc for starting i3 and setting wallpaper

# set wallpaper
exec feh --bg-scale /home/cooky/Pictures/wallpapers/world/bl1920.jpg &
# use the "-l" option until version "3e"
exec i3 -l

Tags: , , , ,



6 Comments

rssComments RSS transmitTrackBack Identifier URI


貌似有xcompmgr的加下面两句就可以透明背景嗯了

URxvt.depth:32
URxvt.background:[80]black

Comment by Lutea on 2010-01-22 15:17


我在我电脑上试了,
URxvt.inheritPixmap: true 和
URxvt.transparent: true
留其中之一都可以, 索性都加上, 反正不出错 :)
我设置 URxvt.depth:32 时终端颜色会不正确, 去掉就好了. 可能跟一些软件包不一样有关

Comment by Xu Hui Hui on 2010-01-22 15:46


感谢分享好东西!:-)

Comment by Lutea on 2010-01-22 16:43


[...] 最近好朋友xhh在blog上推荐使用i3,我就try了一下,但是i3似乎与ubuntu9.10不够磨合,以失败告终。 [...]

Pingback by 开始使用wmii ‹ Lutea on 2010-01-25 22:55


Execuse me, how to display Chinese font in window titlebar?

# ISO 10646 = Unicode
font -misc-fixed-medium-r-normal–13-120-75-75-C-70-iso10646-1
cannot work.

Comment by i3-wm on 2010-04-04 20:35


The Chinese font problem is really troublesome… After trying for some time I gave up finally.

Comment by Xu Hui Hui on 2010-04-06 10:23

Sorry, the comment form is closed at this time.

1 条评论:

  1. Finally, I found a Chinese X11 core font that can be rendered flawlessly in window title bar under i3 tiling window manager.
    In Debian or Ubuntu, issue "sudo aptitude install xfonts-wqy" to use WenQuanYi bitmap song font, then modify the font configuration line within ~/.i3/config as the following:
    font -wenquanyi-*-medium-r-normal-*-13-130-75-75-p-80-iso10646-1

    回复删除