openbox+tint2+pnmixer+conky=轻量级archlinux桌面环境设置备忘缘起机器上的Ubuntu 12.04有一段时间没有使用了,最近在用的时候发现频繁死机的情况,开始以为是unity的原因,于是换成了gnome3,然而好景不长很快又频繁死机了。作为一个懒得折腾的人,还是重装系统最省事了。想来想去,还是装了archlinux。设置安装过程不必细说,arch的wiki上有详细的说明。这里只是简单的记录下配置过程。网络配置使用wicd替换了默认的netctl
systemctl stop netctlsystemctl disable netctlpacman -S wicd wicd-gtksystemctl start wicdsystemctl enable wicd
并在~/.config/openbox/autostart中加入wicd-gtk -t &图形界面图形界面我选择了轻量级的openbox。pacman -S openbox然后是openbox配置的一系列工具openbox主题及设置工具pacman -S openbox-themes obconfopenbox右键菜单我选用了AUR的obmenu-generator,其动态菜单(pipe menu)功能尤其方便,在安装了新的软件后也无需重新设置右键菜单。yaourt -S obmenu-generator快捷键编辑工具obkey和菜单编辑工具obmenupacman -S obkey obmenu安装轻量级登录管理器slimpacman -S slim桌面环境面板使用了tint2,在启动脚本中添加tint2 &yaourt -S tint2-svn tint2-themes tint2wizard尽管安装了tint2的设置工具,我目前使用的依然是tint2的默认主题,因为基本上能满足我的需求:)。其他的面板工具可以尝试下fbpanel、wbar、xfce4-panel等,总有一款panel适合你。音量控制使用了pnmixer,在启动脚本中加入pnmixer &yaourt -S pnmixer轻量级监控工具conky及conky配置生成工具conky-colorsyaourt -S conky conky-colors在启动脚本中加入/usr/share/conkycolors/bin/conkyStart &壁纸工具使用了nittrogenpacman -S nittrogen选择壁纸后在启动脚本中加入nitrogen –restore &阴影工具使用了compton-gityaourt -S compton-git在启动脚本中加入compton -cC -f -i 1.0 -e 1.0 -o 1.0 -r 6 -l -9 -t -9 -I 0.05 -O 0.05 -D 2 -G -b &其他工具文件管理器 pacman -S pcmanfm看图工具 pacman -S geeqie gpicview图片编辑 pacman -S gimp浏览器 pacman -S chromium输入法 pacman -S fcitx fcitx-googlepinyin在~/.xinitrc中加入
export LANG=zhCN.UTF-8export LCALL=”zhCN.UTF-8″export XMODIFIERS=@im=fcitxexport GTKIMMODULE=fcitxexport QTIM_MODULE=fcitx
并在启动脚本中加入fcitx &文字编辑工具 yaourt -S kingsoft-officepdf阅读器 yaourt -S mupdf apvlv屏幕保护程序 yaourt -S xscreensaver

*****************************************************************************轻量级桌面 openbox + tint2 + conky + stalonetray + pcmanfm + xcompmgr
轻量级桌面果然很难弄..还好我之前是用gnome的比较起来会简单一点首先是安装需要的软件了sudo aptitude install openbox obconf obmenu conky stalonetray pcmanfm xcompmgr tint2我是编译安装对的首先到tint2 google code下载源码 http://code.google.com/p/tint2/然后 cd /home/wdstudio/Desktop/tint2-0.9./configure  makesudo make install安装完毕了暂时需要的软件就有了logout在登录时选则openbox-session不用在~/.xinitrc里加入exec openbox-session这么麻烦反正我们有gdm…到这里就进入openbox了,看起来很糟糕首先先调用pcmanfm , 是用来代替nautilus的,虽然我很喜欢nautilus 不过貌似nautilus 和openbox经常打架就换轻量级的pcmanfm恩,让pcmanfm每次都启动的话要在~/.config/openbox/autostart.sh中添加( sleep 2 && pcmanfm -d ) &忘记哪里找来的语句了,和大多数人都不一样… 记得sleep 2 &&是让openbox和要启动的程序有一些缓冲时间 pcmanfm -d 则是让pcmanfm在后台运行 每行结束都要加上 &各位自己去折腾一下pcmanfm把,壁纸等都能用他设定了# update-mime-database /usr/share/mime# update-desktop-database这两行很重要,不然会丢失所有的文件关联这个时候的openbox还很简略没有成型不过没关系从终端运行obmenu就可以定制openbox的右键了obconf是openbox的设定可以换主题等sudo aptitude install openbox-themes安装主题,当然gnome-look等地方还有很多好看的主题 # Run the system-wide support stuff. $GLOBALAUTOSTART# feh –bg-scale /home/wdstudio/Pictures/Wallpaper/wallpaper_0150.jpg &#xcompmgrif which xcompmgr > /dev/null; thenxcompmgr -Ss -n -Cc -fF -I-10 -O-10 -D1 -t-3 -l-4 -r4 &fi(sleep 2 && conky ) &(sleep 2 && /usr/local/bin/tint2 ) &(sleep 2 && pcmanfm -d ) &# (sleep 2 && nautilus –no-desktop ) &( sleep 2 && stalonetray ) &#( sleep 2 && /usr/bin/dmenu_run & ) &( sleep 2 && dropbox ) &( sleep 2 && gnote ) &这是我的autostart.sh
关于openbox的快捷键就要手动编辑了vi ~/.config/openbox/rc.xml找到<keyboard>部分快捷键的编写其实很见到找到规律就好了最长见的有<keybind key=”KEY”><action name=”Execute”<execute>command</execute></action></keybind>KEY代表你要的快捷键command就是指令了比如    <keybind key=”A-t”>      <action name=”Execute”>        <execute>gnome-terminal</execute>      </action>    </keybind>    <keybind key=”W-e”>      <action name=”Execute”>        <execute>pcmanfm ~</execute>      </action>    </keybind>一个是terminal的一个是pcmanfm的具体可以看http://openbox.org/wiki/Help:Actions之后就是tint2了在上面的autostart.sh里面已经看到tint2自动启动了tint2的配置文件在./config/tint2/tint2rc怎么配置打架自己着墨吧
autostart.sh里面的xcompmgr -Ss -n -Cc -fF -I-10 -O-10 -D1 -t-3 -l-4 -r4 &就是调用xcompmgr让窗口出现阴影效果,关于xcompmgr的具体我自己都不清楚,等下去google了
conky就不用多说了, ( sleep 2 && conky ) & 搞定,如此简单附上我的配置background yes# Use Xft?use_xft yesxftfont Comic Sans MS:size=8
use_spacer top_right
# Update interval in secondsupdate_interval 1
# This is the number of times Conky will update before quitting.# Set to zero to run forever.total_run_times 0
# Create own window instead of using desktop (required in nautilus)own_window  yesown_window_transparent yesown_window_type widgetown_window_hints undecorate,sticky,skip_taskbar,skip_pager 
# Use double buffering (reduces flicker, may not work for everyone)double_buffer yes
# Minimum size of text area#minimum_size 280 5
maximum_width 150
# Draw shades?draw_shades no
# Draw outlines?draw_outline no
# Draw borders around textdraw_borders no
# Stippled borders?stippled_borders 0
# border marginsborder_margin 5
# border widthborder_width 0
# Default colors and also border colorsdefault_color 4d4d4d#default_shade_color white#default_outline_color blackown_window_colour 262626
# Text alignment, other possible values are commented#alignment top_leftalignment top_right#alignment bottom_left#alignment bottom_right
# Gap between borders of screen and text# same thing as passing -x at command linegap_x 5gap_y 5
# Subtract file system buffers from used memory?no_buffers yes
# set to yes if you want all text to be in uppercaseuppercase no
# number of cpu samples to average# set to 1 to disable averagingcpu_avg_samples 2
# number of net samples to average# set to 1 to disable averagingnet_avg_samples 2
# Force UTF8? note that UTF8 support required XFToverride_utf8_locale yes
# Add spaces to keep things from moving about?  This only affects certain objects.use_spacer yes
TEXT${font OpenLogos:size=26}      B${color 8F8F8F}${alignc 23}${font DotMatrix:size=16}      ${time %k:%M}${font}${color EE6363}${alignc}${voffset -10}${time %B} ${time %Y}
${color 7C96B0}${font DejaVu Sans Mono:size=6}${execpi 300 DJS=`date +%_d`; cal | sed ‘1d’ | sed ‘/./!d’ | sed ‘s/$/                     /’ | fold -w 21 | sed -n ‘/^.{21}/p’ | sed ‘s/^/${alignc} /’ | sed /” $DJS “/s/” $DJS “/” “‘${color 98AE68}'”$DJS”‘${color 8F8F8F}'” “/}${font}
${color 7C96B0}Kernel:${color 8F8F8F}${alignr}$kernel${color 7C96B0}UpTime:${color 8F8F8F}${alignr}$uptime${color 7C96B0}CPU : ${color 8F8F8F}${alignr}AMD X4 630${color 7C96B0}Core One:${color 8F8F8F}${alignr}${cpu cpu1}% ${color EE6363}#${color 7C96B0}Core 1 temp:${color EE6363}${alignr}${execi 20 sensors it8718-isa-0290 |grep temp1 |cut -c15-16}°C${color 262626}${cpugraph cpu1 20,85 262626 1E1E1E} ${color 7C96B0}Core Two:${color 8F8F8F}${alignr}${cpu cpu2}% ${color EE6363}#${color 7C96B0}Core 2 temp:${color EE6363}${alignr}${execi 20 sensors it8718-isa-0290 |grep temp2 |cut -c15-16}°C${color 262626}${cpugraph cpu2 20,85 262626 1E1E1E} ${color 7C96B0}Ram:${color 8F8F8F}${alignr}$mem${color 1A1A1A}${membar 3,85}
#${color 7C96B0}Public Ip:${color EE6363}${alignr}${execi 1 ~/.scripts/ip.sh}  ${color EE6363}|${color}  ${color EE6363}${color 7C96B0}Public Ip:  ${execi 3600 wget -O – http://whatismyip.org/ | tail}${color 98AE68}${font PizzaDude Bullets:size=10}N${font}${color EE6363}${alignr}${upspeed eth0}KB/s${color 262626}${upspeedgraph eth0 20,85 1E1E1E 1A1A1A}${color 7C96B0}Total: ${color 8F8F8F}${totalup eth0}${color 98AE68}${font PizzaDude Bullets:size=10}T${font}${color EE6363}${alignr}${downspeed eth0}KB/s${color 262626}${downspeedgraph eth0 20,85 1E1E1E 1A1A1A}${color 7C96B0}Total: ${color 8F8F8F}${totaldown eth0}
${color 98AE68}Disk IO:${color EE6363} ${alignr 4}$diskio#${color 7C96B0}Main HardDisk Temp:${color EE6363}${alignr}${execi 300 nc localhost 7634 | cut -c23-24;} °C${color 262626}${diskiograph 20,85 1E1E1E 1A1A1A}${color 7C96B0}WDSTUDIO:${color 8F8F8F}${alignr}${fs_free /home/wdstudio/}${color 1A1A1A}${fs_bar 3,85 /home/wdstudio/}${color 7C96B0}File:${color 8F8F8F}${alignr}${fs_free /media/File/}${color 1A1A1A}${fs_bar 3,85 /media/File/}${color 7C96B0}Data:${color 8F8F8F}${alignr}${fs_free /media/Data/}${color 1A1A1A}${fs_bar 3,85 /media/Data/}${color 7C96B0}eMule:${color 8F8F8F}${alignr}${fs_free /media/eMule/}${color 1A1A1A}${fs_bar 3,85 /media/eMule/}
${color 7C96B0}PROCESSES ${hr 2}${color 7C96B0}NAME             ${goto 110}PID${goto 138}CPU%${goto 175}MEM%${color 7C96B0}${top name 1}    ${goto 105}${top pid 1}${goto 138}${top cpu 1}${goto 175}${top mem 1}${color 7C96B0}${top name 2}    ${goto 105}${top pid 2}${goto 138}${top cpu 2}${goto 175}${top mem 2}${color 7C96B0}${top name 3}    ${goto 105}${top pid 3}${goto 138}${top cpu 3}${goto 175}${top mem 3}${color 7C96B0}${top name 4}    ${goto 105}${top pid 4}${goto 138}${top cpu 4}${goto 175}${top mem 4}${color 7C96B0}${top name 5}    ${goto 105}${top pid 5}${goto 138}${top cpu 5}${goto 175}${top mem 5}
#quod libet ${hr 2}
# ${voffset 4}${alignc 35}${font Buttons and Switches JL:size=26}wd${font}#${voffset 7}${execi 7 quodlibet –print-playing ‘<title>’}#${alignc 35} – ${execi 7 quodlibet –print-playing ‘<artist>’}
#Banshee ${hr 2}#${voffset 7}${exec banshee-1 –query-title}#${alignc 35}  — ${exec banshee-1 –query-artist}#${exec banshee-1 –query-track-number}# ${exec banshee-1 –query-album}#${exec banshee-1 –query-position}我的.conkyrc坑坑洼洼的,大家不要介意stalonetray是系统托盘,既然不在gnome了就没有gnome-panel了用stalonetray来代替,配置文件在~/.stalonetrayrc第一件是就是透明transparent truegeometry 124×24+3-3icon_gravity NWwindow_layer bottom sticky true这是我的配置
继续使用gtk主题和图标是我遇到最大的麻烦了,应该是安装lxappearance,gtk-chtheme就能解决问题的,可是我的图标被固定了不能换,自己写.gtkrc-2.0也不可以.gtkrc.mine也不可以我就想到更简单的方法了,直接调用gnome-panel来换$ gnone-panel换好了在kill掉$ pkill gnome-panel
以前习惯用gnome-do了,换到openbox当然什么都要light那就上dmenu , 这个确实折腾了很长时间( sleep 2 && dmenu_run & ) & 细心的人注意到了,dmenu_run 后面还有一个 &配合   <keybind key=”W-space”>      <action name=”Execute”>        <command>dmenu_run</command>      </action>    </keybind>刚刚好达到gnome-do的效果忘记说了W代表Super,A代表Alt,C代表Ctrl,小的字母才是A-Z
不能忘记gnome下的Alt+F2 ,代替他的是gmrun快捷键怎么写大家应该都知道了把
还有一个很重要的,那就是关于openbox的关机等脚本感谢tony3322提供的脚本cd /usr/local/binvi powerdown
#!/bin/bashans=$(zenity –list –title “Make your choice” –text “What should I do?”–radiolist –column “Choice” –column “Action” reboot reboot logout logout poweroff poweroff);echo $anscase $ans in’reboot’)echo “reboot”sudo reboot;;’logout’)echo “logout”killall openbox;;’poweroff’)echo “poweroff”sudo poweroff;;esac保存起来sudo chmod a+x powerdownsudo visudo添加%users ALL=NOPASSWD: /sbin/haltALL ALL=NOPASSWD:/sbin/poweroffALL ALL=NOPASSWD:/sbin/reboot

在obmenu里面添加
差不多就是这样了以后想到什么在添加把最后附上截图