首页 > 未分类 > 配置ArchLinux+slim+openbox+tint2等

配置ArchLinux+slim+openbox+tint2等

2014年4月20日 发表评论 阅读评论    

archlinux安装使用也有一段时间了,也没时间整理安装笔记,就一股脑发上来吧

archlinux基本系统安装见安装ArchLinux,接下来配置ArchLinux+slim+openbox+tint2等
一、用户管理(增加普通用户),如果看不到中文,运行export en_US.UTF-8(LANG=en_US.UTF-8)
useradd -m -s /bin/bash saxon
passwd saxon
二、启用multilib仓库(32位库)
vi /etc/pacman.conf去掉multilib的注释
pacman -Syy
三、图形界面
1、安装X
pacman -S xorg-server xorg-xinit xorg-utils xorg-server-utils (或者pacman -S xorg)
pacman -S mesa  (3D支持)
2、安装显卡驱动 (virtualbox里的,真实机看wiki)
pacman -Ss virtualbox
pacman -S virtualbox-guest-iso
pacman -S virtualbox-guest-utils
modprobe -a  vboxguest vboxsf vboxvideo
vi /etc/modules-load.d/virtualbox.conf
 vboxguest
 vboxsf
 vboxvideo
vi ~/.xinitrc在exec前加入
/usr/bin/VBoxClient-all
真实机:
pacman -Ss xf86-video-ati
3、安装输入设备驱动
如果有触摸版,执行
pacman -S xf86-input-synaptics
4、配置X(无操作)
5、测试X(可略过?未证实)
pacman -S xorg-twm xorg-xclock xterm
startx
exit

6、安装字体
pacman -S ttf-dejavu
pacman -S wqy-bitmapfont
pacman -S wqy-microhei
pacman -S wqy-zenhei
接下来就是窗口、登陆管理器等
#窗口管理器openbox https://wiki.archlinux.org/index.php/Openbox
pacman -S openbox obmenu oblogout obconf obkey
mkdir -p ~/.config/openbox
cp /etc/xdg/openbox/{rc.xml,menu.xml,autostart,environment} ~/.config/openbox
#obmenu配置右键菜单
#obmenu设置
#win+F1到F4是切换桌面
#登陆管理器slim https://wiki.archlinux.org/index.php/Slim
pacman -S slim
systemctl enable slim.service
#编辑.xinitrc,在最后加入(无论什么时候,都保持在最后)
exec openbox-session
#设置默认用户
vi /etc/slim.conf
 default_user       saxon
 auto_login yes
#主题
pacman -S slim-themes archlinux-themes-slim
编辑/etc/slim.conf中的current_theme那行,将"default"改为你想要的主题名,添加多个主题,使用,分隔就可以使用随机主题了
slim -p /usr/share/slim/themes/<theme name> 预览主题
 current_theme      archlinux,archlinux-simplyblack,archlinux-darch-grey,archlinux-darch-white,archlinux-soft-grey,capernoited,fingerprint,lake,parallel-dimensions,fbsd,slim-gentoo-simple
另外可以下载
pacman -S wget
http://slim.berlios.de/themes/fbsd-slim-theme.tar.bz2
http://nchc.dl.sourceforge.net/project/slim.berlios/slim-gentoo-simple.tar.bz2
#openbox菜单自动生成工具,不推荐,具体配置见 https://wiki.archlinux.org/index.php/Openbox
1、MenuMaker 需要执行命令
pacman -S menumaker
mmaker -vf OpenBox3
2、xdg_menu 安装新软件自动生成,配置见
pacman -S xdg_menu
右键菜单很简单,直接编辑/home/新用户/.config/openbox/menu.xml文件,在你想加入图标的菜单项前面,写入ICO文件的路径与名称即可。
例如,下面是我的一个代码片段:      
< menu id="1" label="编程工具与文本编辑器" icon="icos/accessories-dictionary.png" >,
唯须注意的是,图片路径我使用的是相对路径,icos文件夹,在我的用户家目录里。icos文件夹中的图标,
是我从/usr/share/icons下去复制过来的。这里最好不要用绝对路径,否则可能有权限问题,图标不能显示出来。
3、obmenu-generator 带彩色图标,自动更新菜单,推荐
yaourt -S obmenu-generator
obmenu-generator -p -i #生成菜单
###############openbox美化 https://wiki.archlinux.org/index.php/Openbox_Themes_and_Apps
#主题(没啥用)
pacman -S openbox-themes
#桌面图标
#桌面壁纸
nitrogen /wallperpath
nitrogen --restore & #加入到openbox/autostart
#应用程序启动器dmenu
pacman -S dmenu
#快捷键设置,在.config/openbox/rc.xml的<keyboard> 段
   <keybind key="A-F2">
     <action name="Execute">
       <execute>dmenu_run -fn -misc-fixed-*-*-*-*-20-200-*-*-*-*-*-*  -i -b -nf 'gray' -sb 'dark green' -nb 'black'</execute>
     </action>
   </keybind>
#文件管理器
1、thunar 支持插件和自动挂载功能
pacman -S thunar thunar-volman
pacman -S gnome-icon-theme #文件夹图标
2、emelfm2 轻量级双面板 
pacman -S emelfm2
3、桌面图标和壁纸,可以安装下面(桌面图标用处不大,放弃,采用nitrogen,具体见上面)
pacman -S pcmanfm
pcmanfm --desktop-pref 设置
pcmanfm --desktop & #加入.config/openbox/autostart
#写个sh,放到auto里,每次重启就换桌面----定时任务更改配置无效
#/bin/bash
s=`date +%M`
num=$[$s/2]
sed "s/[^/]*\.jpg/${num}.jpg/g" pcmanfm.conf.bak > pcmanfm.conf
4、鼠标主题
pacman -S xcursor-themes
mkdir /usr/share/icons/default
vim /usr/share/icons/default/index.theme添加
[Icon Theme]
Name = whiteglass
Inherits = whiteglass
#开启命令自动完成
pacman -S bash-completion
或
在~/.bashrc中加入:
#Enabling tab-completion
complete -cf sudo
complete -cf man
#关机脚本
pacman -S zenity
#!/bin/bash
ans=$(zenity --list --title "退出系统" --text "操作列表"\
--你要干什么? --column "选择" --column "执行" \
注销 logout 重启 reboot 关机 poweroff);
echo $ans
case $ans in
'注销')
echo "logout"
killall openbox
;;
'重启')
echo "reboot"
sudo reboot
;;
'关机')
echo "poweroff"
sudo poweroff
;;
esac
写到某个文件里,执行该文件就可以了,会弹出一个选择框的
#修改并美化桌面图标
1、启动pcmanfm,在”编辑“菜单的最下端是”偏好设置“,打开”偏好设置“,在”显示“选项卡中,设置”大图标尺寸“与”小图标尺寸“,即可改变桌面图标的大小,根据你屏幕的分辨率,你可以设置一个值,让你桌面的图标变得小巧好看。比如我的,设置的”大图标尺寸“是”32x32“,显示效果就很好;
2、在/usr/share/applications/下运行”桌面偏好设置“,设定桌面文字的字体与大小(比如我设的,是文泉驿微米黑,10号字)、再设定文本的颜色与文字阴影的颜色,稍稍细心一点,微调一下,整个桌面的效果就非常好
#窗体界面的美化
安装lxappearance工具,即可对GTK的窗体效果进行设置,以我安装的为例---
  pacman -S lxappearance gtk-engines
上面命令,同时安上GTK的设置工具与GTK最常用的主题。其实可以任选一个主题做基础,然后自己在这个基础之上,自定义窗体、按钮的颜色与灰度等等。这个就不具体再展开聊了,安装完后,自己运行/usr/share/applications/下的”自定义外观和体验“,即可进行窗体的风格设置。如果有兴趣,那么可以在网上找到一大堆的各种主题风格包,下载下来在这里安装一下就行了。当然,最有成就感的,还是拿一个风格为底本,自己手工慢慢在这处底本之下,改出自己喜欢的主题风格出来。
#字体
#锁屏
1、自动锁屏
pacman -S slock #这个锁屏没有密码输入框,直接输入密码即可,xlockmore(密码框太丑) xscreensaver(难用) xautolock(没效果)
vim /etc/oblogout.conf 更改lock行
#建议把这个配置里的内容加到菜单里,加入openbox的快捷键列表里
<keybind key="C-A-l">
<action name="Execute">
<command>slock</command>
</action>
</keybind>
2、屏保锁屏
#加入~/.config/openbox/autostart
xscreensaver -no-splash &
#网络管理界面
1、wicd https://wiki.archlinux.org/index.php/Wicd_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
pacman -S wicd wicd-gtk notification-daemon
停止其他工具
systemctl stop netcfg
systemctl stop dhcpcd@.service
systemctl stop NetworkManager.service
禁用其他工具
systemctl disable netcfg
systemctl disable dhcpcd@.service
systemctl disable NetworkManager.service
添加服务
systemctl enable wicd.service
把自己帐号添加到users组
gpasswd -a saxon users
启动
systemctl start wicd
运行图形界面
wicd-client (wicd-client -n 不显示在通知区域)
2、NetworkManager (未成功)
pacman -S network-manager-applet xfce4-notifyd hicolor-icon-theme gnome-icon-theme
移除/etc/xdg/autostart/nm-applet.desktop
在.config/openbox/autostart里加入
(sleep 3 && /usr/bin/nm-applet --sm-disable) &
#virtualbox虚拟机
pacman -S virtualbox virtualbox-guest-iso gksu
modprobe -a vboxdrv vboxnetflt vboxnetadp vboxpci
#加到/etc/modules-load.d/virtualbox.conf里实现自动挂载:vboxdrv vboxnetflt vboxnetadp vboxpci
pacman -S virtualbox-guest-iso
#更新内核自动编译模块
yaourt -S vboxguest-hook linux-headers
将vboxguest加入/etc/mkinitcpio.conf中的 HOOKS 数组,请留意linux(或者任何其它内核) 安装包的安装过程。 vboxguest hook 会提示是否有错误的。如果有报错,应该是headers没有更新或者优先更新
使用
pacman -Sy linux-headers && pacman -Su
让linux-headers先更新
pacman -S dkms
systemctl start dkms.service
systemctl enable dkms.service
pacman -S virtualbox-host-modules virtualbox-host-dkms virtualbox-guest-dkms virtualbox-guest-modules
#conky
把.conkyrc拷贝到家目录下,然后加入到~/.config/openbox/autostart
#安装软件
pacman -S vim terminator chromium guake ntfs-3g flashplugin openssh vlc
pacman -S file-roller unrar zip unzip p7zip arj unace unarj
#翻译
pacman -S stardict
去http://abloz.com/huzheng/stardict-dic/下载安装词典
#图片查看器
pacman -S gpicview
#pdf查看器
pacman -S evince
#fcitx
pacman -S fcitx-im
#fcitx-googlepinyin https://wiki.archlinux.org/index.php/Fcitx
pacman -S fcitx-googlepinyin
#在.xinitrc加入
export XIM=fcitx
export XMODIFIERS="@im=fcitx"
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XIM_PROGRAM=fcitx
#加入.config/openbox/autostart,在/etc/xdg/autostart/下有fcitx-autostart.desktop,所以不用加下面这行了
fcitx &
#设置谷歌拼音、竖排、候选词9个
pacman -S fcitx-configtool
fcitx-configtool
#如果在chromium里无法使用,首先可以手动启动一下fcitx看看有什么报错,如果还是不行,就切换到root用户执行
/usr/bin/gtk-query-immodules-2.0 > etc/gtk-2.0/gtk.immodules
#安装yaourt
vim /etc/pacman.conf
#加入法国的源
 [archlinuxfr]
   SigLevel = Optional TrustAll
  Server = http://repo.archlinux.fr/$arch
pacman -Syu
pacman -S abs
abs(abs要运行两次)
pacman -S yaourt
yaourt -S tint2-svn    //不要了
找到# Panel:
# Panel
panel_items = LTSBC
找到新的一节# Launchers:
# Launchers
launcher_icon_theme = LinuxLex-8
launcher_padding = 5 0 10
launcher_background_id = 9
launcher_icon_size = 85
launcher_item_app = /some/where/application.desktop
launcher_item_app = /some/where/anotherapplication.desktop
#让任务栏可以右键打开openbox的桌面菜单
设置wm_menu的值为1
#tint2 https://wiki.archlinux.org/index.php/Tint2
pacman -S tint2
#加入.config/openbox/autostart
tint2 &
tint2conf设置宽度100%
#窗口透明 https://wiki.archlinux.org/index.php/Tint2 https://wiki.archlinux.org/index.php/Xcompmgr
1、pacman -S xcompmgr
#加入.config/openbox/autostart
xcompmgr &
#设置单个窗口的透明度设置工具(没啥用)
pacman -S transset-df
2、yaourt -S compton-git(这个方法的透明好像只看到桌面)
在~/.config/compton.conf 里加入
# Shadow
shadow = true;			# Enabled client-side shadows on windows.(淡入淡出)
no-dock-shadow = true;		# Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true;		# Don't draw shadows on DND windows.
clear-shadow = true;		# Zero the part of the shadow's mask behind the
				# window. Fix some weirdness with ARGB windows.
shadow-radius = 7;		# The blur radius for shadows. (default 12)
shadow-offset-x = -7;		# The left offset for shadows. (default -15)
shadow-offset-y = -7;		# The top offset for shadows. (default -15)
# shadow-opacity = 0.7;		# The translucency for shadows. (default .75)
# shadow-red = 0.0;		# Red color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-green = 0.0;		# Green color value of shadow. (0.0 - 1.0, defaults to 0)
# shadow-blue = 0.0;		# Blue color value of shadow. (0.0 - 1.0, defaults to 0)
shadow-exclude = [ "n:e:Notification" ];	# Exclude conditions for shadows.
# shadow-exclude = "n:e:Notification";
shadow-ignore-shaped = true;	# Avoid drawing shadow on all shaped windows
				# (see also: --detect-rounded-corners)

# Opacity
menu-opacity = 0.9;			# The opacity for menus. (default 1.0)
inactive-opacity = 0.9;			# Default opacity of inactive windows. (0.0 - 1.0)
# active-opacity = 0.8;			# Default opacity for active windows. (0.0 - 1.0)
# frame-opacity = 0.8;			# Opacity of window titlebars and borders. (0.1 - 1.0)
# inactive-opacity-override = true;	# Let inactive opacity set by 'inactive-opacity' overrides
					# value of _NET_WM_OPACITY. Bad choice.
alpha-step = 0.06;			# XRender backend: Step size for alpha pictures. Increasing
					# it may result in less X resource usage,
					# Yet fading may look bad.
# inactive-dim = 0.2;			# Dim inactive windows. (0.0 - 1.0)
# inactive-dim-fixed = true;		# Do not let dimness adjust based on window opacity.
# blur-background = true;		# Blur background of transparent windows.
					# Bad performance with X Render backend.
					# GLX backend is preferred.
# blur-background-frame = true;		# Blur background of opaque windows with transparent
					# frames as well.
blur-background-fixed = false;		# Do not let blur radius adjust based on window opacity.
blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'" ];
					# Exclude conditions for background blur.

# Fading
fading = true;			# Fade windows during opacity changes.
# fade-delta = 30;		# The time between steps in a fade in milliseconds. (default 10).
fade-in-step = 0.03;		# Opacity change between steps while fading in. (default 0.028).
fade-out-step = 0.03;		# Opacity change between steps while fading out. (default 0.03).
# no-fading-openclose = true;	# Avoid fade windows in/out when opening/closing.
fade-exclude = [ ];		# Exclude conditions for fading.

# Other
backend = "xrender"		# Backend to use: "xrender" or "glx". GLX backend is typically
				# much faster but depends on a sane driver.
mark-wmwin-focused = true;	# Try to detect WM windows and mark them as active.
mark-ovredir-focused = true;	# Mark all non-WM but override-redirect windows active (e.g. menus).
use-ewmh-active-win = false;	# Use EWMH _NET_WM_ACTIVE_WINDOW to determine which window is focused
				# instead of using FocusIn/Out events. Usually more reliable but
				# depends on a EWMH-compliant WM.
detect-rounded-corners = true;	# Detect rounded corners and treat them as rectangular when --shadow-ignore-shaped is on.
detect-client-opacity = true;	# Detect _NET_WM_OPACITY on client windows, useful for window
				# managers not passing _NET_WM_OPACITY of client windows to frame
				# windows.
refresh-rate = 0;		# For --sw-opti: Specify refresh rate of the screen. 0 for auto.
vsync = "none";			# "none", "drm", "opengl", "opengl-oml", "opengl-swc", "opengl-mswc"
				# See man page for more details.
dbe = false;			# Enable DBE painting mode. Rarely needed.
paint-on-overlay = false;	# Painting on X Composite overlay window. Recommended.
sw-opti = false;		# Limit compton to repaint at most once every 1 / refresh_rate.
				# Incompatible with certain VSync methods.
unredir-if-possible = false;	# Unredirect all windows if a full-screen opaque window is
				# detected, to maximize performance for full-screen windows.
focus-exclude = [ ];		# A list of conditions of windows that should always be considered
				# focused.
detect-transient = true;	# Use WM_TRANSIENT_FOR to group windows, and consider windows in
				# the same group focused at the same time.
detect-client-leader = true;	# Use WM_CLIENT_LEADER to group windows.
invert-color-include = [ ];	# Conditions for windows to be painted with inverted color.

# GLX backend			# GLX backend fine-tune options. See man page for more info.
# glx-no-stencil = true;	# Recommended.
glx-copy-from-front = false;	# Useful with --glx-swap-method,
# glx-use-copysubbuffermesa = true; # Recommended if it works. Breaks VSync.
# glx-no-rebind-pixmap = true;	# Recommended if it works.	
glx-swap-method = "undefined";	# See man page.

# Window type settings
wintypes:
{
  tooltip = { fade = true; shadow = false; opacity = 0.75; focus = true; };
  # fade: Fade the particular type of windows.
  # shadow: Give those windows shadow
  # opacity: Default opacity for the type of windows.
  # focus: Whether to always consider windows of this type focused.
};
#加入.config/openbox/autostart
compton --config ~/.config/compton.conf &    #如果没有--config,会报错
#如果想开机小键盘灯亮
pacman -S numlockx
#加入openbox/autostart
numlockx &
#dropbox
yaourt -S dropbox
#音量
yaourt -S pnmixer
在.config/openbox/autostart里加入
pnmixer &
#archlinux没有ifconfig命令
#ifconfig,route在net-tools中,nslookup,dig在dnsutils中,ftp,telnet等在inetutils中,ip命令在iproute2中。
pacman -S net-tools dnsutils inetutils iproute2
#美化
pacman 4.1.0 开始支持彩色输出,只需要在/etc/pacman.conf中取消 Color 行前面的注释即可使用。
#truecrypt
pacman -S truecrypt
加loop模块自启动,lsmod查看是否已加载,modprobe loop加载
见https://wiki.archlinux.org/index.php/Truecrypt
#XTerm中文方块
1、Ctrl+Right click。
2、Sudo vim /usr/share/X11/app-defaults/XTerm
大概102行或者附近改为如下:实际上是增大Xterm的默认字体大小
原 *VT100.utf8Fonts.font: -misc-fixed-medium-r-semicondensed--16-120-75-75-c-60-iso10646-1
改 *VT100.utf8Fonts.font: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
如果有顾虑,可以将该行注释,重新写一行试试,测试中倒数第3个数字才是起作用的数字,从60改到90,马上好用了
修改颜色也在这里改,如:黑底绿字
XTerm*background: black
XTerm*foreground: green
XTerm*scrollbar: no
#netbeans菜单问题
修改 $NetBeans/etc/netbeans.conf
在 netbeans_default_options 里面添加 ” –fontsize 12″
#如果碰到未加入autostart,却自动启动的,可以查看/etc/xdg/autostart/和~/.config/autostart/里是否有*.desktop文件
#nautilus也可以管理桌面图标和背景,但是需要安装gnome-tweak-tool,这个软件会要求安装相当多的扩展
#当然也可以作为纯粹的文件管理器,优点是支持图片预览
#使用此工具的时候,启动使用如下:nautilus --no-desktop
#每装一个新软件都执行下面
mmaker -vf OpenBox3
#Ctrl-Alt-Backspace无法退出X
#无法加载'(null)'字体https://wiki.archlinux.org/index.php/Xorg
#中文化
https://wiki.archlinux.org/index.php/Arch_Linux_%E4%B8%AD%E6%96%87%E5%8C%96
#终端彩色
https://wiki.archlinux.org/index.php/Color_Bash_Prompt
#字体
https://wiki.archlinux.org/index.php/Fonts
https://wiki.archlinux.org/index.php/Font_Configuration
https://www.ibm.com/developerworks/cn/linux/l-cn-gnome/?S_TACT=105AGX52&S_CMP=techccid
XDG基本目录规范定义了五个重要的环境变量。这些环境变量统一了所有相关MIME文件的位置。

$XDG_DATA_HOME:定义了用户相关的数据文件的基路径。如果这个变量为空,或没有定义,缺省路径$HOME/.local/share将被使用。

$XDG_CONFIG_HOME:定义了用户相关的配置文件的基路径。如果这个变量为空,或没有定义,缺省路径为$HOME/.config。

$XDG_DATA_DIRS:定义了除了$XDG_DATA_HOME外数据文件的搜索路径。超过一个的搜索路径用冒号分隔。如果这个变量为空,或没有定义,缺省路径为/usr/local/share/:/usr/share/。

$XDG_CONFIG_DIRS:定义了除了$XDG_CONFIG_HOME外的配置文件的搜索路径。超过一个的搜索路径用冒号来分隔。如果这个变量为空,或没有定义,缺省路径为/etc/xdg/。

$XDG_CACHE_HOME:定义了用户相关的非必须的数据的搜索路径。如果这个变量为空,或没有定义,缺省路径为$HOME/.cache。

用awesome窗口管理器(太麻烦,放弃)
pacman -S awesome
mkdir -p ~/.config/awesome/
cp /etc/xdg/awesome/rc.lua ~/.config/awesome
分类: 未分类 标签:
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 5.00 out of 5)
Loading...
  1. 本文目前尚无任何评论.
您必须在 登录 后才能发布评论.