<<

ExerciseExercise 2,2, PartPart (a)(a) –– BuildBuild XX windowwindow Introduction Architecture X11 implementation The Manager Install X11 Configuring X11 Install Afterstep Configuring Afterstep Classic Apps X Startup Remote X X11 Forwarding • • • • • • • • • • • • Steps of Exercise Appendix utline utline O ‰ ‰ ‰ O

Computer Center, CS, NCTU 2 veloped as part of Project rred to as ‘X’ is the or “X11”, Athena at MIT. 1987: X Version 11 is released. now controlled and maintained by the Group. 1993: X11R6 2005/12: X11R7 The X Windows System, also refe standard graphical engine for and . It is largely OS and hardware independent, it network-transparent, and it supports many different desktops. 1984: The X Window system was de ¾ ¾ ¾ ¾ ¾ ¾ What is X Window System? What • • Introduction X Window System (1) ‰ X Window System (1)

Computer Center, CS, NCTU 3 X Window System Version 11 Release 6 X Window System Version 11 Release 7 X11R6.9.0 2005 Dec.21 X11R7.3 2007 Sep.6 – – – – X Window System X Version 11 X Window System, Version 11 X11 X11R6 X11R7 From X.Org ¾ ¾ ¾ ¾ ¾ ¾ ¾ Naming Version Latest version • • • X Window System (2) X Window System (2)

Computer Center, CS, NCTU 4 The X client request display service The X server provide display service Communicate with X Protocol ¾ ¾ ¾ A client-server architecture • Architecture: X Window System (3) ‰ X Window System (3)

Computer Center, CS, NCTU 5 ng X libraries (e.g. ) Request service (like create window) Request (like mouse input) events from X server Receive An application written usi application written An locally and accepts multiple X clients Runs the keyboard, mouse and display device Manage draw and destroy graphic objects on screen Create, – – – – – – Client Server ¾ ¾ Client-Server Design • X Window System (4) X Window System (4)

Computer Center, CS, NCTU 6 ing the same ing look The X server is highly portable (various OS, Language) high portability also have The X Clients X support most oriented network protocol Local and network based comput – – – – The X Protocol is also divided into device dependent and independent layers. Advantages of X protocol ¾ ¾ X Protocol • X Window System (5) X Window System (5)

Computer Center, CS, NCTU 7 From 2004 From From 1992 From Latest Version: 4.7.0 Aug. 12, 2007 X11 official flavor Latest Version of R7: 7.3 Sep.6, 2007 ¾ ¾ ¾ XFree86 project foundation Xorg • • Open-source implementations of X Window System Open-source implementations X11 implementation ‰ X11 implementation

Computer Center, CS, NCTU 8 des certain look-and-feel window Size: resize, minimize, maximize Size: move Overlap, Position: – – Background, desktop, Window attributes and operations ¾ ¾ ¾ in front of you. A special kind of “X Client” provi A special kind of “X Client” • The Window Manager (1) ‰ The Window Manager (1)

Computer Center, CS, NCTU 9 AfterStep Gnome KDE … ¾ ¾ ¾ ¾ ¾ ¾ Examples: The Window Manager (2) ‰ The Window Manager (2)

Computer Center, CS, NCTU 10 Install X11 Configuring X11 Install Afterstep Configuring Afterstep Steps of this exercise 1. 2. 3. 4. Steps of this exercise

Computer Center, CS, NCTU 11 ake-4* /var/db/pkg/XFree86-* X_WINDOW_SYSTEM=xorg pkg_delete -f /var/db/pkg/im Xorg as our X Server – – Add the following line in /etc/make.conf the following line Add /usr/bin/csup /usr/bin/csup –L 1 /usr/local/etc/cvsup-ports use We this line (If you had ever installed XFree86) Do • • • • Use cvsup to update your ports Pre-steps: Installing X11 (1) ‰ ‰ Installing X11 (1)

Computer Center, CS, NCTU 12 2G free space this port had been deprecated, expiration date: 2007/12/25 % login as root % cd /usr/ports/x11/xorg % make install clean % login as root % cd /usr/ports/x11/XFree86-4 % make install clean ¾ ¾ ¾ ¾ ¾ ¾ ※ It will run about 1 hours (or more) Athlon64 3500+ 1GB Ram 100MB NIC Install Xorg needs To build and install Xorg from the ports To • We use Xorg as our X Server If you want to install XFree86 (not recommended!) Installing X11 (2) ‰ ‰ Installing X11 (2)

Computer Center, CS, NCTU 13 know your hardware Ex: 31 ~ 81 KHz Ex: 56 ~ 76 KHz Ex: ATi Radeon 9200SE Ex: nVIDIA GeFource FX5200 7500 (16M) (IBMT30) Ex: ATI Mobility RADEON Ex:128MB – – – – – – – Horizon Synchronization frequency Vertical Synchronization frequency ¾ ¾ Monitor specifications adaptor chipset Video Adapter Memory Video • • • Pre-step Configuring X11 (1) ‰ Configuring X11 (1)

Computer Center, CS, NCTU 14 (Xorg) (XFree86) The file will be put in /root/xorg.conf.new The file will be put in /root/XF86Config.new – – % Xorg –configure % XFree86 –configure ¾ ¾ Generate an X11 configuration skeleton file Steps of X11 configuration 1. Configuring X11 (2) ‰ Configuring X11 (2)

Computer Center, CS, NCTU 15 to leave the test ” and an X mouse cursor xf86config /root/XF86Config.new (XFree86) Ctrl+Alt+Backspace config /root/xorg.conf.new (Xorg) If a black and grey grid appear, the configuration was successful Press “ % XFree86 – % Xorg – ¾ ¾ Test the existing configuration • • Configuring X11 (3) 2. Configuring X11 (3)

Computer Center, CS, NCTU 16 Identifier "Mouse0" Identifier "auto" Option "Protocol" "/dev/sysmouse" Option "Device" Identifier "Monitor0" ModelName "Monitor Model“ HorizSync 31.0 - 81.0 Driver "mouse" 5" "4 Option "ZAxisMapping" VendorName "Monitor Vendor" VertRefresh VertRefresh 76.0 - 56.0 EndSection EndSection Section "InputDevice" Section "Monitor" Section Monitor Section Screen Section InputDevice – – – Edit /root/xorg.conf.newEdit /root/XF86Config.new (Xorg) (XFree86) ¾ ¾ Tune Configuration file Tune Configuration Modes "1280x1024" "1024x768" Viewport 0 Depth 24 3. Identifier "Screen0" Monitor "Monitor0“ EndSubSection Device "Card0" DefaultDepth 24 SubSection "Display" Configuring X11 (4) Configuring X11 (4) EndSection Section "Screen"

Computer Center, CS, NCTU 17 tc/X11/XF86Config (XFree86) ” Ctrl+Alt+F1~F8

/usr/local/lib/X11//xinitrc Press “

– – % cp /root/xorg.conf.new /etc/X11/xorg.conf% cp /root/XF86Config.new /e (Xorg) % startx Switch to View xinitrc -geometry 50x50-1+1 & ¾ ¾ ¾ ¾ ¾ Copy configuration file to real place Startup X window & Configuring X11 (5) Configuring X11 (5) # start some nice programs xclock -geometry 80x50+494+51 & xterm -geometry 80x20+494-0 & exec xterm -geometry 8 0x66+0+0 -name login 4. 5. [Comment]

Computer Center, CS, NCTU 18 install clean (1) (1) WITH_DIFFERENT_LOOKNFEELS D – WITH_SAVEWINDOWS Afterstep Afterstep D – http://www.afterstep.org/ % cd /usr/ports/x11-wm/afterstep-stable % make • • • Here we use afterstep our WM as Installation Install ‰ ‰ Install

Computer Center, CS, NCTU 19 # start some nice programs exec afterstep To execute afterstep ~/.xinitrc (2) (2) System Default: System Default: Personal: /usr/local/lib/X11/xinit/xinitrc – – Afterstep Afterstep File Location: Format: just like a script! ¾ ¾ Edit “xinitrc” Edit • Configuring X11 to use afterstep System Default # start some nice programs & twm xclock -geometry 50x50-1+1 & xterm -geometry 80x50+494+51 & xterm -geometry 80x20+494-0 & exec xterm -geometry 80x66+0+0 -name login Install ‰ Install

Computer Center, CS, NCTU 20 (3) (3) Afterstep Afterstep force to quit X % startx Ctrl + Alt Backspace Î Left button: copy Right button: paste • • • • Run Your X-Window Usage Install Install ‰ ‰

Computer Center, CS, NCTU 21 iguration files, and then read global configuration files for those not found. configuration files for Follow “.include” configuration /usr/local/share/afterstep/ ~/.afterstep/ It first tries to read personal conf ¾ ¾ ¾ ¾ Global configuration file directory Personal configuration file directory Personal configuration first Global configuration if missing personal Copy what you want to change from global personal and modify it. And Add “.include” include other global you need. to • • • • • • Location of configuration file When AfterStep starts To make personal configuration AfterStep Configuration (1) ‰ ‰ ‰ AfterStep Configuration (1)

Computer Center, CS, NCTU 22 Pager module MinitorWharf feel look Animation WinList Start menu AfterStep Configuration (2) AfterStep Configuration (2) Wharf module WinTab

Computer Center, CS, NCTU 23 Purpose Afterstep configuration file Define what is run when AfterStep starts and restarts Animate Module configuration file file Pager module configuration Wharf/MonitorWharf module configuration file WinList module configuration file Start menu when you click left button Define how AfterStep feels Define how AfterStep looks Name Under /usr/local/share/afterstep/ base autoexec animate pager wharf winlist start/ feels/ looks/ AfterStep Configuration (3) ‰ AfterStep Configuration (3)

Computer Center, CS, NCTU 24 Exec “Firefox" exec firefox & MiniPixmap "mini-app.xpm" Configuration (4) Configuration (4) install your favorite applications install first Add entry under directory Add entry file the Edit menu Update • • • • Steps to add something start menu AfterStep AfterStep ‰ % ls 0_Applications 3_Screen_savers 6_nop 1_Desktop 4_Windows 7_About_AfterStep 2_Modules 5_Quit % ls 0_Applications 3_Screen_savers 6_nop 1_Desktop 4_Windows 7_About_AfterStep 2_Modules 5_Quit f_firefox

Computer Center, CS, NCTU 25 bg black & bg black & yellow -bg black & ile (ex. add Term Folder) ile (ex. Configuration (5) Configuration (5) itor1,dots/3_dots Folder xec "-" aterm -tr -tint blue -fg yellow - xec "-" -tr -fg xec "-" Eterm -O --tint blue -fg yellow - rm Exec "-" xterm -fg yellow -bg blue & Edit wharf configuration f • Add something to wharf module AfterStep ‰ AfterStep *Wharf aterm E … *Wharf Terms large/Mon *Wharf rxvt E *Wharf eterm E *Wharf xterm xte *Wharf ~Folder …

Computer Center, CS, NCTU 26 xterm xclock Appendix A: classic x apps (1) ‰ ‰ Appendix A: classic x apps (1)

Computer Center, CS, NCTU 27 Not this xeyes xbiff xman Appendix A: classic x apps (2) ‰ ‰ ‰ Appendix A: classic x apps (2)

Computer Center, CS, NCTU 28 ~/.xinitrc /usr/local/lib/X11/xinit/xinitrc ~/ .xserverrc /usr/local/lib/X11/xinit/xserverrc script to initiate an X session – – – – – Default client script: does not exist) (run xterm if .xinitrc Default server script: does not exist) (run X if .xserverrc startx: ¾ ¾ ¾ Files xinit [ xinit [ client ] options -- [ server ] display options • xinit - X Window System initializer Appendix B: X Startup (1) ‰ Appendix B: X Startup (1)

Computer Center, CS, NCTU 29

secure

on

-nodaemon" xterm dm ~/.xsession ttyv8 "/usr/local/bin/x – /etc/ttys Default script ¾ ¾ Xdm provides services similar to those provided byinit, andgetty login on character terminals Files: • • - Appendix B: X Startup (2) ‰ Appendix B: X Startup (2)

Computer Center, CS, NCTU 30 defaults to “0” defaults client client - - “0” in most cases “0” in [hostname]:displaynumber[.screennumber] %startx -listen_tcp %xhost +remotehost %setenv DISPLAY=server:display ¾ ¾ ¾ Start X Server with tcp connection support X Server with tcp Start for the remote host to display X clients on Permit local machine. set DISPLAY for remote X clients • • • To launch an X client from a remote host for display on the local X server, you need to do following steps: not needed if localhost Appendix : remote x ‰ Appendix C: remote x

Computer Center, CS, NCTU 31

) may be dangerous Y( – ssh -X ent a security hazard. : r Enables trusted X11 forwarding: ssh Enables X11 forwarding: Execute any X clients you want ve X11 forwarding should be enabled with caution. Users with the bypass file permissions on the remote host (for ability to user's X authorization database) can access the local X11 display through the forwardedconnection. An attacker may through display then be able to perform activities such as keystroke monitoring. ¾ ¾ ¾ X11 forwarding can repres er Connection to X11 DISPLAY can be forward by ssh, any programs started will go through the encrypted channel. Client: • •S • ※ Note: To forward X11 connection Appendix D: X11 forwarding ‰ Appendix D: X11 forwarding

Computer Center, CS, NCTU 32