X Window là gì ? A network-transparent window system Phần mềm có thể chạy trên 1 máy tính và truyền hình ảnh của nó sang 1 máy tính khác... X Graphical Interfaces Open Look và Motif
Trang 1X Window – RPM
Trang 2Lịch sử X-Window
Hệ thống X Window được phát triển trong
Laboratory for Computer Science tại MIT
(Massachusetts Institute of Technology) như là một phần trong dự án Athena hợp tác với DEC,
và được phát hành lần đầu vào năm 1984
Người chủ trì dự án là Robert Scheifler, và phiên bản X đầu tiên chịu ơn “W” Windowing package (“W” Windowing package được phát triển bởi Paul Asente tại Stanford)
Tháng 9 ,1987, MIT xuất phiên bản X11 đầu tiên
mà chúng ta còn sử dụng đến ngày nay
Trang 3X Window là gì ?
A network-transparent window system
Phần mềm có thể chạy trên 1 máy tính và truyền hình ảnh của nó sang 1 máy tính khác
Trang 4Biến $DISPLAY
Hostname:displaynumber.screennumber
Ví dụ: alibaba.citd.edu.vn:0.0
Dùng bởi một ứng dụng để xác định nó kết nối vào server nào và màn hình nào
Hostname: tên máy hoặc ip address.
Displaynumber: bắt đầu từ 0 (hầu hết
các máy hiện nay chỉ có 1 màn hình)
Screennumber: Một vài màn hình chia sẽ
1 bàn phím và pointer giữa hai hay nhiều monitors
Trang 6Computer A Computer B
X Server
Trang 7Cấu hình MS Windows
hiển thị X-window
Sử dụng X-server chạy trên Windows
là X-WinPro
cài đặt x-winpro Chọn các options
mặc định ( không cần thay đổi hay
chỉnh sửa cấu hình gì hết)
Trang 8Cấu hình MS Windows
hiển thị X-window (tiếp theo)
Sau đó login vào máy Linux export
chạy X-WinPro bằng lệnh:
export DISPLAY=ip_addr_máy_Win:0.0
Chạy thử 1 chương trình ứng dụng
xterm &
sau đó đánh lệnh startkde & để
tiến hành sử dụng giao diện GUI
của KDE
Trang 9Chọn Window Manager
Thông thường khi cài đặt Linux có
rất nhiều Window manager cho
chúng ta chọn lựa Nhưng đối với
các version Linux sau này người ta thường chọn GNOME mặc định cho chúng ta Khiến đôi khi ta lầm
Trang 10KDE Desktop
Trang 11xterm
Trang 12Control Center
Trang 13File Manager
Trang 14Các mode X Window
Đối với các người dùng đã quen thuộc với các môi trường window trên các OS khác
có rất nhiều window managers để
emulate desktop mà họ đã quen thuộc
http://www.ezskins.com/top10.phtml?
LinuxKDEthemes
http://www.lysator.liu.se/~marcus/
amiwm.html là một kiểu Amiga
Workbench window manager
dfm http://www.kaisersite.de/dfm/, mô phỏng OS/2 Workplace Shell.
Trang 15X Graphical Interfaces
Open Look và Motif đã sớm cố gắng chuẩn
hoá X Window và làm cho nó trở nên hữu
dụng trong các môi trường khác nhau, không chỉ trên các workstations Cả hai đều thành
công theo một nghĩa nào đó ( look and feel)
và có thể được dùnng dưới các hệ Linux mới
Khởi đầu với X11 Release 5, Sun
Microsystem's OpenWindows graphical
interface được phát triển cho X users Nó bao goàm 2 phiên bản của Open Look Window
Manager, olwm và olvwm (with a virtual
desktop) Nó được phát triển bởi Sun trong sự
hy vọng chuẩn hoá môi trường window, và
thực tế đã chứng minh được đó là chuẩn cho Solaris trong nhiều năm.
Trang 16Cmdtool on Solaris
Trang 17File Manager on Solaris
Trang 18 KDE is a powerful Open Source
graphical desktop environment for Unix workstations It combines ease
of use, contemporary functionality, and outstanding graphical design
with the technological superiority of the Unix operating system
http://www.kde.org
Trang 19KDE Project Overview
The KDE project is a large open group of developers consisting of several hundred software engineers from all over the
world committed to free software
Trang 20Why is there a need for KDE?
The traditional X11 desktop exhibits
among others the following shortcomings:
No easy dialog based desktop configuration
No unified application help system
No common application development
framework
No compound document framework
Lack of network transparency on the
application level
Authoring of X11 applications extremely
difficult and tedious
Trang 21KDE - The users view
A good looking contemporary and complete network transparency desktop
An integrated help system
Consistent look and feel of all KDE
applications
Standardized menu and toolbars,
keybindings, color-schemes, etc
Internationalization: KDE is available in
more than 50 languages
Centralized consisted dialog driven desktop configuration
A great number of useful KDE applications
Trang 22The current KDE distribution
The current KDE distribution consists of the following packages:
aRts: Analog realtime synthesizer and sound daemon
KDE-Libs: Various run-time libraries
KDE-Base: The base components manager, desktop, panel, Konqueror)
(window- KDE-Network: KNode, KNewsticker, Kppp,
KDE-Pim: KMail, KAddressbook, KOrganizer, KPilot,
Trang 23KDE distribution (cont)
KDE-Graphics: Graphics applications such
as KDVI, KGhostview, KPaint, KFax,
KDE-Multimedia: Noatun, KMidi, KSCD,
KDE-Utilities: KEdit, KCalc, KHexEdit,
KNotes,
KDE-Edu: Edutainment related programs
KDE-Games: KAsteroids, KPat, KTetris,
KDE-Toys: Fun stuff
Trang 24KDE distribution (cont)
KDE-Addons: Addons for Konqueror, Kate, Kicker and Noatun
KDE-Artwork: icons, styles, wallpapers, screensavers and window decorations
KDE-Admin: Various tools to aid system
administration
KDE-SDK: Script and tools which simplify development
of KDE applications
KOffice: Integrated office suite
KDevelop: C/C++ Integrated Development
Environment
Quanta: Web Development Tool
Trang 25KDE Facts and Figures
KDE is a big project While it is very hard to quantify what this means exactly, note that:
The KDE CVS source code repository holds
currently about 4.0 million lines of code (The
Linux kernel version 2.5.71 consists in about 3.7 million lines of code.)
Over 800 contributors help to develop KDE
The translation team alone consists of about 300 individuals
11,014 CVS commits were made during May 2002
KDE has more than 17 official WWW mirrors in
over 12 countries
KDE has more than 106 official FTP mirrors in over
39 countries
Trang 26 The GNOME Project is an effort to create a complete, free and easy-
to-use desktop environment for
users, as well as a powerful
application development framework for software developers.
Trang 28Chương trình xfontsel
Trang 29 wght - font weight (bold, medium, etc.)
slant - font slant (italics, oblique, roman (normal), etc.)
sWdth - font width (normal, condensed,
Trang 30Ý nghĩa xfontsel (tt)
ptSz - approximate point size of the text (similar to pxlsz)
resx - horizontal resolution, in dpi
resy - vertical resolution, in dpi
spc - spacing, only useful,
apparently, in the Schumacher fonts
avgWidth - average character width
of the font
rgstry - the recognized registry
that lists the font
encdng - nationality encoding
Trang 32True Type Fonts in X Window
Nếu bạn đã từng dùng các hệ Windows khác như
MS Windows hoặc MacOS, ban có rất nhiều fonts
đã pre-installed trong máy tính của bạn roài đó là TrueType fonts TrueType fonts được xem là tốt nhất trên các màn hình nhỏ, độ phân giải thấp và làm cho màn hình của bạn trông mịn hơn
X không hiểu TrueType fonts, và không có khả
năng tự hiểu và do đó nó cần một số chương trình chuyển font cho nó Có một FreeType library làm điều này, nhưng nếu bạn chỉ muốn dùng nó trên máy tính của bạn, tất cả những gì bạn cần là một chương trình tên xfstt (X font server for
TrueType).
ftp://metalab.unc.edu/pub/Linux/X11/fonts/
Trang 33Cài đặt True Type Font
Cài đặt chương trình này rất dễ
Extract the archive, và make file, và sau đó make install Bạn có thể gặp một vài lỗi nhưng không quan trọng lắm hãy bỏ qua nó những gì bạn
phải làm tiếp là tạo một thư mục
cho phép ghi gọi là /usr/ttfonts và đặt một vài fonts *.ttf tại đó Sau
đó đoàng bộ font server với lệnh
xfstt sync.
Trang 34Cài đặt True Type Font
Nếu bạn gặp lỗi , hãy chạy font
server trong background với lệnh
xfstt & và chỉ cho X11 server về
font servicevới lệnh xset fp+
unix/:7100 Nếu bạn không gặp lỗi thì hãy chạy Netscape, thậm chí
xfontsel, và sẽ thấy các fonts này sẵn sàng
Trang 35Cài đặt True Type Font (tt)
Trong các phiên bản Linux mới, có một số thay đổi trong xset (RedHat 6.0 trở lên), bạn chạy thử xset fp+ unix/:7101
Nếu tất cả làm việc tốt, lúc này bạn sẽ muốn lưu lại cấu hình hệ thống lại sao cho lần chạy sau ta không phải làm lại
Tất cả những gì bạn phải làm là thêm 2 lệnh mới
ở đoạn trên vào xinitrc file
Nếu bạn startx thông qua xdm, bạn sẽ thêm
/usr/X11R6/bin/xfstt & vào file
/usr/X11R6/lib/X11/xdm/Xsetup_0 Sau đó thêm
xset fp+ unix/:7100
Trang 36VNI Fonts
Trước hết bạn hãy download bộ fonts vni ( có tại
http://www.fedu.uec.ac.jp/~vuhung/linux/font-rpms/
Sau đó bạn kiểm tra xem trong hệ thống đã có font vni chưa bằng lệnh
# xlsfonts |grep vni
Nếu có các fonts vni-*** xuất hiện nghĩa là quá trình cài fonts của bạn đã thành công mỹ mãn
Lúc này bạn hãy chạy netscape và chọn font vni
để xem các Web site có tiếng Việt ( font vni 2byte
Trang 38Redhat Package Management
RPM
Trang 40Lịch sử RPM
RedHat Package Management
RPM V1:
Perl based, simple database format
Automatic handling of configuration files
Erase or rebuilding large numbers of packages
Ability to verify the package installation
Trở thành RPM Package Manager- được sử dụng rộng rãi bởi các Linux Distributors khác
Version hi ện tại là v4
Trang 43 Làm mới package, nó chỉ install khi có
1 package cũ tồn tại trong hệ thống
Trang 44Removing packages
Trang 46rpm –qi lynx
[root@pascal natuan]# rpm -qi lynx
Name : lynx Relocations: (not relocateable)
Version : 2.8.5 Vendor: Red Hat, Inc.
Release : 11 Build Date: Sat 25 Jan 2003 12:10:43 AM EST
Install Date: Sat 25 Oct 2003 04:12:16 PM EDT Build Host:
Lynx is a text-based Web browser Lynx does not display any images,
but it does support frames, tables, and most other HTML tags One
advantage Lynx has over graphical browsers is speed; Lynx starts and
exits quickly and swiftly displays webpages.
[root@pascal natuan]#
Trang 47Ràng buộc
Depends: Khi cài đặt 1 package, thường các package có ràng buộc với nhau Ví dụ muốn cài package B thì phải có package A được cài trước.
Để cài đặt bỏ qua các ràng buộc:
rpm –Uvh nodeps package_name
rpm –Uvh force package_name
rpm –Uvh force nodeps
package_name
Kiểm tra trước khi cài đặt
rpm –Uvh test package_name
Trang 50Công cụ RPM
redhat-config-packages