Chủ Nhật, 7 tháng 11, 2010

Ghi chép quá trình cài đặt Ubuntu-Openbox 10.10

(Quá trình cài đặt được thực hiện trong máy ảo Virtualbox)


Từ Ubuntu Alternate
Ubuntu-Openbox 10.10 sau khi cài đặt hoàn chỉnh trong máy ảo


1- Cài đặt hệ thống Ubuntu tối thiểu (chỉ có giao diện dòng lệnh):
tương tự bài viết http://tutroc77.blogspot.com/2010/07/xay-dung-ubuntu-openbox-tu-ia-cai.html đến hết phần 2


2- Nội dung file /etc/apt/sources.list

deb http://debian.nctu.edu.tw/ubuntu/ maverick main restricted universe multiverse
deb http://debian.nctu.edu.tw/ubuntu/ maverick-updates main restricted universe multiverse
deb http://debian.nctu.edu.tw/ubuntu/ maverick-security main restricted universe multiverse




3- Các gói Openbox và các gói phần mềm cơ bản đã cài:

alsa-utils alsa-oss xserver-xorg-video-vesa xinit menu-xdg openbox-xdgmenu obconf obmenu

lxdm lxpanel lxshortcut lxtask lxappearance lxrandr pcmanfm gvfs policykit-desktop-privileges plymouth-label gnome-alsamixer hardinfo seahorse rcconf gparted gcc

gdebi synaptic software-center system-config-printer-gnome system-config-printer-udev gnome-power-manager network-manager-gnome ubuntu-restricted-extras non-free-codecs shiki-wise-theme jockey-gtk

ibus-unikey usb-creator-gtk sakura htop leafpad scrot vlc gpicview epdfview parcellite osmo speedcrunch catfish transmission-gtk firefox cheese pidgin xarchiver unzip p7zip

acpid powernowd pm-utils gpointing-device-settings numlockx



*** Thông tin:

- Đã thêm các kho PPA là LXDE-Ubuntu và Ubuntu-VN. Nhưng kho LXDE-Ubuntu chưa có các gói cho Ubuntu 10.10 Maverick. Do đó không cài được PCManFM2
- Gói "non-free-codecs" chỉ cài được sau khi thêm kho của Medibuntu: https://help.ubuntu.com/community/Medibuntu và: http://www.unixmen.com/linux-distributions/4-ubuntu/1241-medibuntu-repository-is-available-for-ubuntu-1010-maverick-meerkat

- Gói "xserver-xorg-video-vesa" kéo theo cả 2 gói "xserver-xorg-input-all" và "xserver-xorg-video-all"
- Gói "lxdm" kéo theo 3 gói "lxde-common", "lxde-core" và "lxsession". Nên sau đó phải tự gỡ bỏ 3 gói này.

- Không còn gói "pm-utils-powersave-policy" cho Maverick

- Gói "pm-utils" được tự động cài theo gói "gnome-power-manager"
- Gói "gvfs" được tự động cài theo gói "pcmanfm"
- Gói "system-config-printer-udev" được tự động cài theo gói "system-config-printer-gnome"

- Gói "cpu-checker" được tự động kéo theo từ một gói nào đó
- Gói "gnome-nettool" được tự động kéo theo từ một gói nào đó



4- Các gói phần mềm bổ xung có sẵn trong kho đã cài:

medit gimp simple-scan gpe-screenshot k3b isomaster exaile audacity k9copy

openoffice.org-l10n-vi openoffice.org-calc openoffice.org-writer openoffice.org-gtk goldendict goldendict-wordnet mpg123 ovdp-english-vietnamese-stardict ovdp-vietnamese-english-stardict

nfs-kernel-server nfs-common tuxcmd tuxcmd-modules

language-pack-gnome-en language-pack-gnome-vi language-pack-kde-en language-pack-kde-vi kde-l10n-engb language-support-input-vi language-support-writing-vi



5- Các phần mềm không có sẵn trong kho đã cài:

Google Chrome: http://www.google.com.vn/chrome?hl=vi

Dropbox: http://www.dropbox.com/downloading?os=lnx

Virtualbox: http://www.virtualbox.org/wiki/Linux_Downloads

Remastersys: http://www.geekconnection.org/remastersys/ubuntu.html



6- Nội dung file ~/.config/openbox/autostart.sh

# Run the system-wide support stuff
. $GLOBALAUTOSTART

# Programs to launch at startup
numlockx on &
pcmanfm --desktop &
lxpanel &
ibus-daemon &

# Programs that will run after Openbox has started
(sleep 1 && gnome-power-manager) &
(sleep 1 && nm-applet) &
(sleep 1 && ibus-gtk) &
(sleep 1 && parcellite) &




7- Nội dung file ~/Desktop/Shutdown.desktop (Biểu tượng Shutdown trên Desktop):

#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=Shutdown
Comment=Shutdown System
Exec=gksu halt
Icon=gnome-logout
Terminal=false
Type=Application
Categories=System
StartupNotify=true



8- Nội dung file ~/Desktop/Reboot.desktop (Biểu tượng Reboot trên Desktop):

#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=Reboot
Comment=Reboot System
Exec=gksu reboot
Icon=system-restart
Terminal=false
Type=Application
Categories=System
StartupNotify=true




9- Thông tin thêm:

- Theme Openbox là Shiki-Wise-LXDE được lấy từ Distro Linux-Mint-LXDE

- Tuy đã cài Virtualbox, nhưng chưa cần sử dụng ngay, nên 2 dịch vụ "vboxdrv" và "vboxweb-service" đã được tắt nhờ công cụ "rcconf". (Chạy lệnh $ sudo rcconf trong cửa sổ dòng lệnh)

- Cũng vậy với NFS, dịch vụ "nfs-kernel-server" cũng đã được tắt.

- Sau khi khởi động vào Ubuntu-Openbox, trong máy ảo 32bit với 1Gb bộ nhớ, hệ thống chiếm dụng chưa đến 70Mb của Ram.



BỔ XUNG ngày 09/11/2010:

- Không hiểu sao mà "Exaile" không chơi nhạc được
- Gói "gcc" chỉ cần thiết để cài Vbox-Guest-Additions cho máy ảo
- 2 gói "k3b" và "k9copy" kéo theo tổng cộng 228Mb các gói từ KDE
- Có lẽ nên cài thêm gói "menu-l10n"

Từ Ubuntu Alternate


- Khi cài trên máy thật, trong lúc cài phần cơ bản, Ubuntu đề nghị cài các gói hỗ trợ ngôn ngữ. Trong các gói này có "ibus-unikey", "language-support-input-vi", v.v... Nhưng khi sử dụng thì không gõ được Tiếng Việt. Nên tôi đã phải gỡ bỏ "ibus", "ibus-unikey" và các gói liên quan. Sau đó cài lại ibus-unikey từ kho của Ubuntu-VN. Rồi cài gói "language-selector" và dùng nó để cài các gói hỗ trợ ngôn ngữ. Cuối cùng thì cũng gõ được Tiếng Việt


Xem bài viết này trên Ubuntu-VN: http://forum.ubuntu-vn.org/viewtopic.php?f=58&t=10968&p=116149#p116149

Đặt phím tắt trong Openbox

Như các Blog trước đã đề cập, Openbox có 3 file cấu hình. Trong đó file ~/.config/openbox/rc.xml có phần cấu hình cho các phím tắt.

Phần cấu hình các phím tắt nằm trong khoảng từ biến [keyboard] đến biến [/keyboard]

(Lưu ý: Trong Blog này không viết được 2 ký tự "nhỏ hơn" và "lớn hơn", tôi phải viết thay bằng 2 ký tự "[" và "]")


Mỗi một phím tắt được khai báo bắt đầu từ biến [keybind key="Phím_Tắt"] và kết thúc bằng biến [/keybind]

Những ghi chú được viết dưới dạng [!-- nội dung ghi chú --]


Dưới đây là một số phím tắt mà tôi sử dụng:


1- Phím tắt với các Desktop:

[!-- Keybindings for desktop switching --]

[keybind key="C-A-Left"][action name="DesktopLeft"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]
[keybind key="C-A-Right"][action name="DesktopRight"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]
[keybind key="C-A-Up"][action name="DesktopUp"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]
[keybind key="C-A-Down"][action name="DesktopDown"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]

[keybind key="S-A-Left"][action name="SendToDesktopLeft"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]
[keybind key="S-A-Right"][action name="SendToDesktopRight"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]
[keybind key="S-A-Up"][action name="SendToDesktopUp"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]
[keybind key="S-A-Down"][action name="SendToDesktopDown"][dialog]no[/dialog][wrap]no[/wrap][/action][/keybind]

[keybind key="W-d"][action name="ToggleShowDesktop"/][/keybind]



2- Phím tắt với các Cửa sổ ứng dụng:

[!-- Keybindings for windows --]
[keybind key="A-F4"][action name="Close"/][/keybind]
[keybind key="A-Escape"][action name="Lower"/][action name="FocusToBottom"/][action name="Unfocus"/][/keybind]
[keybind key="A-space"][action name="ShowMenu"][menu]client-menu[/menu][/action][/keybind]

[!-- Keybindings for window switching --]
[keybind key="A-Tab"][action name="NextWindow"/][/keybind]
[keybind key="A-S-Tab"][action name="PreviousWindow"/][/keybind]
[keybind key="C-A-Tab"][action name="NextWindow"][panels]yes[/panels][desktop]yes[/desktop][/action][/keybind]



3- Phím tắt với LXPanel:

[!--keybindings for LXPanel --]
[keybind key="W-r"][action name="Execute"][command]lxpanelctl run[/command][/action][/keybind]
[keybind key="A-F2"][action name="Execute"][command]lxpanelctl run[/command][/action][/keybind]
[keybind key="C-Escape"][action name="Execute"][command]lxpanelctl menu[/command][/action][/keybind]
[keybind key="F11"][action name="ToggleFullscreen"/][/keybind]



4- Một số phím tắt quan trọng:

[!-- Launch Task Manager with Ctrl+Alt+Del (LXTask) --]
[keybind key="A-C-Delete"][action name="Execute"][command]lxtask[/command][/action][/keybind]

[!-- Fast access to Terminal (Sakura) --]
[keybind key="C-A-T"][action name="Execute"][command]sakura[/command][/action][/keybind]

[!-- Fast access to filemanager (PCManFM) --]
[keybind key="W-e"][action name="Execute"][startupnotify][enabled]true[/enabled][name]PCManFM[/name][/startupnotify][command]pcmanfm[/command][/action][/keybind]

[!-- Keybinding for PrintScreen Key (Scrot) --]
[keybind key="Print"][action name="Execute"][execute]scrot[/execute][/action][/keybind]
[keybind key="A-Print"][action name="Execute"][execute]scrot -s[/execute][/action][/keybind]



5- Phím tắt với Âm lượng:

[!-- Keybindings for Multimedia Keys --]
[keybind key="XF86AudioMute"][action name="Execute"][execute]/usr/bin/volume.sh mute[/execute][/action][/keybind]
[keybind key="XF86AudioRaiseVolume"][action name="Execute"][execute]/usr/bin/volume.sh up[/execute][/action][/keybind]
[keybind key="XF86AudioLowerVolume"][action name="Execute"][execute]/usr/bin/volume.sh down[/execute][/action][/keybind]



Giải thích:
- C là phím Ctrl
- A là phím Alt
- S là phím Shift
- W là phím Windows
- Left, Right, Up, Down là các phím di chuyển trái, phải, lên, xuống


Xem bài viết này trên Ubuntu-vn: http://forum.ubuntu-vn.org/viewtopic.php?f=58&t=10968&p=116073#p116073