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.

Arch Linux Forums / [Solved] I3 WM: date and time in statusbar?

Arch Linux Forums / [Solved] I3 WM: date and time in statusbar?

Arch Linux Forums

Discussion forums for Arch Linux, a simple, lightweight linux distribution.

You are not logged in.

#1 2010-04-02 16:20:24

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 81

[Solved] I3 WM: date and time in statusbar?

Hey, just recently switched from xmonad to I3 and so far I really like it (never got around to learn haskell). The only thing still missing is to display at least the current time and maybe also the date in the statusbar. I at least couldn't find anything in the docs or manpage, so maybe there is no way to do that?

Last edited by JonathanArcher (2010-04-06 15:37:41)

Offline

#2 2010-04-02 16:32:15

karol
Member

Registered: 2009-05-06
Posts: 1095

Re: [Solved] I3 WM: date and time in statusbar?

i3status: "i3status – Generates a status line for dzen2 or wmii"
http://manpages.ubuntu.com/manpages/kar … tus.1.html

Last edited by karol (2010-04-02 16:34:02)

Offline

#3 2010-04-02 17:45:28

litemotiv
Member
From: Molvania
Registered: 2008-08-01
Posts: 844

Re: [Solved] I3 WM: date and time in statusbar?

or just conky

Offline

#4 2010-04-02 21:11:07

lasu1
Member

Registered: 2010-02-10
Posts: 70

Re: [Solved] I3 WM: date and time in statusbar?

You can also try Dzen2, which allows you to add pretty much anything to a status bar (its what I use...works well).

Offline

#5 2010-04-03 07:13:00

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 81

Re: [Solved] I3 WM: date and time in statusbar?

Thanks guys, I'm using i3status in combination with dzen2 now, you can't use one on its own can you?
Just need to get around and configure it properly as I only have a centered date and time at the top of my screen.

Offline

#6 2010-04-03 11:07:43

lasu1
Member

Registered: 2010-02-10
Posts: 70

Re: [Solved] I3 WM: date and time in statusbar?

Yeah, I just manually lowered (by using the -x and -y values in dzen) my dzen2 bar so that it fit in the area where the workspace tags are. I am quite sure there is a better way to do it...but that's how I did it smile

Offline

#7 2010-04-03 18:04:31

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 81

Re: [Solved] I3 WM: date and time in statusbar?

Me again, hopefully the last time. I just configured dzen2 and i3status (just like lasu1 was pointing it out), but I can't seem to get it to autostart properly.

I put the whole command to start both (i3status | dzen etc &) into my xinit.rc before the "exec i3" part, but what then happens is that I only see my background wallpaper and the dzen2 bar, but i3 does not load. When I comment the dzen part out of the xinit.rc everything works fine again, and I can start it manually without any problems.

Is there a different way to autostart the statusbar?

Offline

#8 2010-04-03 18:09:56

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 495
Website

Re: [Solved] I3 WM: date and time in statusbar?

i put this line in my .i3/config

Code:

# execute my startup programs
exec ~/.startup

then I create ~/.startup with the following

Code:

gary@Lister ~ $ cat .startup
#!/bin/bash
# Login startup

xautolock -locker johnny -corners +000 -nocloseout &
xrdb ~/.Xdefaults
display -window root .wallpaper.png
sudo conky | dzen2 -x 100 -y 1009 -w 1180 -ta r -bg black -fg '#1793d1' -fn -*-terminus-*-*-*-*-12-*-*-*-*-*-iso8859 &

xclock -geometry 100x90+1170+893 &
sleep 2
i3-msg bb

don't forget to make ~/.startup executable

Offline

#9 2010-04-03 23:27:57

lasu1
Member

Registered: 2010-02-10
Posts: 70

Re: [Solved] I3 WM: date and time in statusbar?

What does i3-msg bb do?

I start the script from xinitrc. Here's mine:
.xinitrc:

Code:

exec i3 --force-xinerama &
sh startup.sh

and the startup script:

Code:

i="1"
feh --bg-scale /media/sdb1/Documents/wall2copia.png

while [ $i = 1 ]
do
DATE=$(date)
MEMINFO=$(sed -n -e '3d' -e '1,4p' /proc/meminfo | awk '{printf "%d ", $2 }')
UPTIME=$(uptime | sed 's/.*://; s/,//g')
QUALITY=$(sed -e '1,2d' /proc/net/wireless | cut -d" " -f6,7)
UNAME=$(uname -a | cut -d" " -f1,2,3)
TEMPS=$(sensors | awk '/C/ { print $3}' | xargs | cut -d" " -f1,2,3,4)
echo "^fg(white)$DATE^fg(grey) | $UNAME | ^fg(white)^i(mem.xbm)^fg(grey) T/F/C $MEMINFO | ^fg(white)^i(net-wifi.xbm) $QUALITY ^fg(grey)| ^fg(white)^i(cpu.xbm)^fg(grey) $UPTIME | ^fg(white)^i(temp.xbm)^fg(grey) $TEMPS"
sleep 5

done | dzen2 -x 150 -y 1005 -w 1050 -bg black -fg grey -fn fixed

Offline

#10 2010-04-04 03:34:40

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 495
Website

Re: [Solved] I3 WM: date and time in statusbar?

i3-msg bb. removes window decorations from the current window. The last window I opened in my startup is xclock. I use the sleep command to gaurantee it has finished drawing and has focus. Then i3-msg bb removes the window borders on xclock.

bn borders-normal
bp borders-1pixel
bb borders-borderless

you can also bind keys to these commands

Code:

# Change window borders bn=normal border bp=1 pixel bb=borderless
bindsym Mod4+comma bn
bindsym Mod4+period bp
bindsym Mod4+slash bb

Last edited by gazj (2010-04-04 04:24:25)

Offline

#11 2010-04-04 04:25:59

gazj
Member
From: /home/gazj -> /uk/cambs
Registered: 2007-02-09
Posts: 495
Website

Re: [Solved] I3 WM: date and time in statusbar?

I also have this dmenu script bound to win+i for i3 commands

Code:

#!/bin/bash

#dmenu_i3
#Gazj 2010 garyjames82atgmaildotcom
#execute i3 commands using dmenu, history stored under ~/.i3/dmenu

if [ -f $HOME/.dmenurc ]; then
. $HOME/.dmenurc
else
DMENU='dmenu -i'
fi

GS=`cat ~/.i3/dmenu | $DMENU -p "i3 command:" $*`

if grep -q "$GS" "$HOME/.i3/dmenu" ; then
echo already exists in history
else
echo $GS >> ~/.i3/dmenu
fi

i3-msg $GS

You can then just press win+i type any i3-msg command and it will be applied to the selected window

Offline

#12 2010-04-04 05:36:49

JonathanArcher
Member
From: San Francisco
Registered: 2008-11-12
Posts: 81

Re: [Solved] I3 WM: date and time in statusbar?

Alright, it worked. I also made a startup script, executed by the i3 config. Strange was though that I again had to adjust the -y value of dzen2, the first time I started my bar was again at the top instead of the bottom.

Thanks a lot guys, I have now deleted xmonad and am happy to use i3 smile

Offline

Board footer

Powered by FluxBB

2010年5月10日星期一

public static byte[] int2Bytes(int num) {
byte[] b = new byte[4];
for (int i = 0; i < 4; i++) {
b[i] = (byte) (num >>> (24 - i * 8));
}
return b;
}

public static byte[] int2ThreeBytes(int num) {
byte[] b = new byte[4];
for (int i = 0; i < 4; i++) {
b[i] = (byte) (num >>> (24 - i * 8));
}
byte[] result = new byte[3];
System.arraycopy(b, 1, result, 0, 3);
return result;
}

2010年4月19日星期一

给 debian 安装 BootSplash - Linux,Linux,Misc,andot,

给 debian 安装 BootSplash - Linux,Linux,Misc,andot,: "给 debian 安装 BootSplash

本文由 andot 于 2005-10-10 20:00:47 提交. Linux
有一些发行版带有 BootSplash,也就是启动画面,有的是进度条的,有的是漂亮的背景加启动文字的。总之是很漂亮了。可惜 debian 默认安装完以后是不带这个东西的。不过我们可以自己安装这个东西,从网上看了一些这方面的介绍,大部分是都是介绍 Gentoo 和 RedHat 的,安装起来都很麻烦,debian 安装这个东西比起那些发行版来说,可以算是简单多了,下面就来看看怎样安装 BootSplash 吧。 首先在你的 apt 源里加上这两行: deb http://debian.bootsplash.de unstable main deb-src http://debian.bootsplash.de unstable main 然后用 apt-get update 更新一下软件列表。 接下来,先安装 bootsplash 的内核补丁 apt-get install kernel-patch-bootsplash 然后重新编译内核: apt-get install debhelper modutils kernel-package libncurses5-dev apt-get install linux-source-2.6.12 apt-get install fakeroot vi /etc/kernel-pkg.conf # 输入我的名字和邮件地址 cd /usr/src # 创建目录 tar -xjvf linux-source-2.6.12.tar.bz2 cd linux-source-2.6.12 # 如果这是你的内核源码 ../kernel-patches/all/apply/bootsplash # 给内核打补丁 cp /boot/config-2.6.12-1-686 .config # 将当前配置设定为默认配置 make menuconfig # 按自己的喜好来定制 make-kpkg clean # 必须执行这步 fakeroot make-kpkg --append_to_version -686 --initrd --revision=2.6.12-10 --stem linux kernel_image modules_image cd .. dpkg -i *.deb 注意:在上面定制内核选项时,要选择下列项目: Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers Processor type and features ---> [*] MTRR (Memory Type Range Register) support Device Drivers ---> Block devices ---> <*> Loopback device support <*> RAM disk support (4096) Default RAM disk size [*] Initial RAM disk (initrd) support Graphics support ---> [*] Support for frame buffer devices [*] VESA VGA graphics support Console display driver support ---> [*] Video mode selection support <*> Framebuffer Console support Bootsplash configuration ---> [*] Bootup splash screen 新内核编译并安装以后,就已经支持 BootSplash,下面就可以安装 BootSplash 的包和主题: apt-get install bootsplash bootsplash-theme-debian sysv-rc-bootsplash 注意:安装 sysv-rc-bootsplash 包时,要确定你的 sysv-rc 的包 2.86.ds1-1(stable) 版本的,如果是 testing 版本安装可能会失败。 配置 bootsplash 时,他会让你选择 initrd 的位置,你就选择你刚刚编译并安装好的那个 /boot/initrd.img-2.6.12-686 就可以了。 然后是配置 grub: title Debian GNU/Linux, kernel 2.6.12-686 (silent) root (hd0,0) kernel /boot/vmlinuz-2.6.12-686 root=/dev/hda1 ro vga=791 splash=silent initrd /boot/initrd.img-2.6.12-686 savedefault boot title Debian GNU/Linux, kernel 2.6.12-686 (bootsplash) root (hd0,0) kernel /boot/vmlinuz-2.6.12-686 root=/dev/hda1 ro vga=791 initrd /boot/initrd.img-2.6.12-686 savedefault boot title Debian GNU/Linux, kernel 2.6.12-686 (recovery mode) root (hd0,0) kernel /boot/vmlinuz-2.6.12-686 root=/dev/hda1 ro single initrd /boot/initrd.img-2.6.12-686.orig savedefault boot 好了,现在选择第一项 Debian GNU/Linux, kernel 2.6.12-686 (silent) ,将进入带进度条动画的启动画面,选第二项 Debian GNU/Linux, kernel 2.6.12-686 (bootsplash),将进入是漂亮的背景加启动文字的启动画面了。 安装不困难,只不过编译内核可能花的时间比较长一些,我编译内核花了 1 个多小时。呵呵。 下面是我编译好的内核(奔4超线程处理器版本)以及相关的 NVidia (显卡)模块和 pwc (摄像头)模块:

linux-image-2.6.12-p4_2.6.12-10_i386.deb nvidia-kernel-2.6.12-p4_1.0.7174-4+2.6.12-10_i386.deb pwc-modules-2.6.12-p4_10.0.7a-5+2.6.12-10_i386.deb

如果你的显卡支持特定的 framebuffer 驱动,你也可以不使用 vesafb,例如我的是 sis 显卡,所以我用的 sisfb,如果要使用 sisfb,那在编译内核是要把 sisfb 编译到内核里去,而不要编译成模块。 之后在加载内核时,用下面的方式来加载 sisfb: title Debian GNU/Linux, kernel 2.6.12-686 (silent) root (hd0,0) kernel /boot/vmlinuz-2.6.12-686 root=/dev/hda1 ro video=sisfb:mode:1024x768x16,rate:85,mem:32768 splash=silent initrd /boot/initrd.img-2.6.12-686 savedefault boot 这样就可以将 framebuffer 下的控制台改成 85Hz 的高刷新率了。 下面是我编译好的带有 sisfb 的内核(奔4超线程处理器版本)以及 pwc (摄像头)模块:

linux-image-2.6.12-sisfb-p4_2.6.12-10_i386.deb pwc-modules-2.6.12-sisfb-p4_10.0.9-1+2.6.12-10_i386.deb

因为启动的时候我无法截图,所以下面是用 qemu 在 Linux 里再次启动我的系统抓的图: grub-splash bootsplash silent-boot silent-shutdown 本文参考:

bootsplash.de - a bootsplash fan site ;) RedHat Linux9下用bootsplash制作全图形启动界面"

Booting ‘Debian Lenny’ into widescreen framebuffer « codehunk

Booting ‘Debian Lenny’ into widescreen framebuffer « codehunk

Yeban's Weblog: Debian Console, Framebuffer, Grub2

Yeban's Weblog: Debian Console, Framebuffer, Grub2: "Debian Console, Framebuffer, Grub2
After a fresh install of Debian the boot up screen looks really ugly. Here are few things you can do to beautify it up. These apply if you use Grub2.

First step is to enable framebuffer. Passing the 'vga=' option to the kernel has been deprecated. To enable framebuffer, open the file /etc/default/grub and change the value of GRUB_GFXMODE variable to the resolution you want. For example:

GRUB_GFXMODE=1280x800

Now open the file /etc/grub.d/00_header and find the lines:

if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
set gfxmode=${GRUB_GFXMODE}
insmod gfxterm

Between the second and the third line (of the above snippet) add:

set gfxpayload=keep

so that it finallly looks like this

if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then
set gfxmode=${GRUB_GFXMODE}
set gfxpayload=keep
insmod gfxterm

Now run, update-grub as root. Do remember to change the default wallpaper with another of the resolution you specified above.

Coming to the fonts part. You need to install the console-setup package in order to be able to customize the console. If you already have it installed run dpkg-reconfigure console-setup as root. You will be presented with terminal based dialogs to chose from various configuration options for the console. On the third screen is the option to choose the font. For me the option 'Do not change the boot/kernel font' works(read, looks) the best. Choose the options that is best for you."

Framebuffer unter Debian GNU/Linux 5.0 "Lenny" Howto — Asconix Systems

Framebuffer unter Debian GNU/Linux 5.0 "Lenny" Howto — Asconix Systems: "Möchte man ab und an auf der Konsole seines Rechners arbeiten, sollte man auf jeden Fall den Framebuffer in dieser aktivieren. Erst die Verwendung des Framebuffers ermöglicht uns, eine angemessene Auflösung in der virtuellen Konsole nutzen zu können.

Um die Auflösung zu konfigurieren, fügen wir die entsprechenden Optionen als Kerneloptionen dem zu ladenden Kernel in der Konfigurationsdatei /etc/boot/grub/menu.lst an. Dazu ersetzen wir in unserem Fall in folgende Zeile der GRUB-Konfigurationsdatei /boot/grub/menu.lst:

kernel /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 ro quiet splash

durch:

kernel /boot/vmlinuz-2.6.26-2-686 root=/dev/sda1 vga=795 splash=silent ro quiet

Die folgenden Werte müssen der vga-Option übergeben werden, um die entsprechende Auflösung des Framebuffers zu aktivieren:

640x480 800x600 1024x768 1280x1024 1600x1200
8 bits vga=769 vga=771 vga=773 vga=775 vga=796
16 bits vga=785 vga=788 vga=791 vga=794 vga=798
32 bits vga=786 vga=789 vga=792 vga=795 vga=799

Anmerkung: soll der Anwender nach der Aulösung während des Bootvorgangs gefragt werden, verwenden wir die Option vga=ask.

Hinweis: Unter Umständen ist die Darstellung bspw. beim Scrollen auf dem Frambuffer extrem langsam. In solchen Fällen sollte ein Framebuffer-Modus ausgewählt werden, der mit lediglich 16 Farben arbeitet (s. obige Tabelle)."

2010年2月27日星期六

buzz tips

Buzz Tips 技巧收集贴: 
1. 搜索 Buzz http://mail.google.com/support/bin/answer.py?hl=cn&answer=173277 
2. 适用 Buzz 的快捷键列表: http://twurl.nl/l8pibo 
3. 经过设置避免泄漏Email 地址: http://twurl.nl/j6urpb 
4. Buzz 官方帮助文档: http://mail.google.com/support/bin/topic.py?topic=27291 
5. Buzz Chrome 及 Firefox 插件:http://blog.go2web20.net/2010/02/new-buzz-extensions-firefox-chrome.html 
6. 通过 http://www.google.com/profiles?q=riku+lu 来搜索想关注的好友。 
7. 通过 Buzz@gmail.com 发送 Post, 可附带图片。 
8. 按 M 键可以 Mute 某条热门的 Post ,减少噪音。 
9. @ 功能,是通过输入 Email 地址来处理的,输入 @ 后再输入Email 地址的开头字符,其它字会自动补全。 
10. 一个接近实时同步Twitter到Buzz的方法,使用我那个twitter-feed的GAE项目同步Twitter到Ping.fm,然后从Ping.fm绑定 GTalk Status ,然后在Buzz中绑定Gtalk即可. http://twurl.nl/ult2e5 
11. 在 Gmail 中过滤 Buzz 更新邮件:http://www.google.org.cn/posts/tips-for-how-to-hide-google-buzz-in-gmail.html 
12. 更简洁的 Buzz 个人页面链接: http://buzz.google.com/yourid 比如 http://buzz.google.com/lu.riku 
13. Buzz 同步到 Twitter : Bizz2Twitter,目前只支持OAuth认证。 http://reader2twitter.appspot.com/buzz 

持续更新,欢迎补允。


--
Roley Zhang from Gmail

2010年1月4日星期一

王斌的博客

王斌的博客: "王斌的博客

想飞之心,永远不死

年月日
从网上搜集的一些Mldonkey设置

Mldonkey是一个非常棒的p2p下载工具,支持多种协议,CS架构,还自带web界面,使用非常方便,下面是我从网上搜集的一些设置技巧。
Enable overnet 和 kademlia

在options里面选All,把enable_overnet和enable_kademlia设置为true。
配置端口映射

在mldonkey的home目录下(gentoo下默认安装目录是/home/p2p/mldonkey),有两个配置文件,donkey.ini和bittorrent.ini,里面有mldonkey使用的bt和电驴的端口,例如我的配置是:
bittorrent.ini

client_port = 6882
tracker_port = 6881

donkey.ini

(* The port used for connection by other donkey clients. *)
port = 11702

(* port for overnet *)
port = 14701

(* port for Kademlia *)
port = 19542

配置路由器为以上5个端口设置端口映射。此外有人1提到还要为donkey端口加4的端口也要设置端口映射,即11706端口。
手动添加kad节点

mldonkey虽然支持kad,但是需要手动添加kad节点。2
节点文件

* http://www.emule-inside.net/nodes.dat
* http://renololo1.free.fr/e/nodes.dat
* http://upd.emule-security.net/nodes.dat
* http://www.nodes-dat.com/

添加方法

下载nodes.dat文件后,在mldonkey的web界面,在输入框中输入下面的命令添加kad节点3:

kad_load /absolute/path/to/your/nodes.dat
Enable buffer

打开缓存,减少写磁盘1:

buffer_writes true
buffer_writes_delay 30
buffer_writes_threshold 1024
client_buffer_size 500000

强制设为highid

ED2K-force_client_high_id true
ED2K-force_high_id true

据说如果不是公网ip或者没有设置端口映射的话,会导致无法链接上服务器2。
设置服务器最大连接数

默认为3,设置为10:

ED2K-max_connected_servers 10

添加服务器

在web界面的Servers页面,点击'Import Server.met',导入server.met。
常用的server.met文件地址

* http://www.emule.org.cn/server.met
* http://www.server-met.de/

也可以手工添加服务器,这里有服务器列表。

还可以通过修改download.ini指定默认下载的server.met4。
调整下载/上传速率

注意上传速度要大于101,小于10的话会限制下载速度,大于3的时候下载速度会被限制为上传速度的4倍,小于4的时候下载速度会被限制为上传速度的3倍。

max-hard-upload-rate: 25 # 0为没有限制
max-hard-download-rate: 120 # 0为没有限制
max_opened_connections:500
max_indirect_connections:30~70

此外还可以设置一组低速率的上传/下载选项,当要上网的时候,点击'Bandwidth toggle'调整成低速率,可以减小对上网浏览的影响。

max-hard-upload-rate_2: 15
max-hard-download-rate_2: 50
max_opened_connections_2:100

设置client_name

修改client_name为[CHN][VeryCD]xxx,这个不太清楚有什么作用,不过上传会有积分,分享的多的话,对下载会有帮助吧。
删除guarding.p2p

这个我还没有测试过,这篇帖子4指出这个文件会屏蔽掉很多国内的server,可以通过修改download.ini文件将其删掉,另篇帖子5也提供了一个替换的办法。
Firefox插件

Firefox MLdonkey/eMule/aMule Protocol Handler这个插件在可以在firefox 3.5.1下运行,推荐使用firefox的用户使用,免去复制粘帖的麻烦。
参考资料

1. 优化MLDonkey少写硬盘,获得HIGHID

2. 优化mldonkey电驴部分

3. mldonkey加速技巧

4. 速度最快的电驴——mldonkey

5. 求mldonkey中的ip blocking终极解决方案

王斌发表于12:17 | Permlink"