EasyPG 1.07 Released
[packages] / xemacs-packages / xwem / man / start.texi
1 @node Getting Started, Primitives, Overview, Top
2 @comment  node-name,  next,  previous,  up
3 @chapter Getting Started
4 @cindex starting
5
6 You must provide some effort in way to make XWEM usable. Configuring
7 XWEM splits to three tasks:
8
9 @menu
10 * Configuring X::       How to configure X server.
11 * Configuring Emacs::   What you need in ~/.emacs to run XWEM.
12 * Configuring XWEM::    How to configure XWEM.
13 @end menu
14
15 @node Configuring X, Configuring Emacs, Getting Started, Getting Started
16 @comment  node-name,  next,  previous,  up
17 @section Configuring X
18 @cindex configuring
19
20 First off all we need to configure keyboard to obtain control over XWEM.
21 XWEM expects that there is Hyper key setuped on your keyboard and that
22 Hyper key acts as modifier(i.e. in X's modifiers list).  Hyper key for
23 XWEM is like Meta key for XEmacs.  All default commands in XWEM uses
24 Hyper.  But it is not necessary to use Hyper key, but recommended.  You
25 can control which modifier to use by @code{xwem-hyper-modifier} variable
26 which default value is @code{hyper}.
27
28 There is two ways to configure Hyper key.  One is using XKB X extension
29 and the other(easier) is using xmodmap application.  Find a key(keycode)
30 to which you want bind Hyper, using @code{xev}@footnote{xev utility
31 ships with X distribution and used to report X events and its
32 description to user.} utility.  Consider it is value 109.
33
34 @example
35 $ xmodmap -e "keycode 109 = Hyper_R"
36 $ xmodmap -e "add mod3 = Hyper_R"
37 @end example
38
39 or add following to your @code{~/.Xmodmap}(or whatever):
40
41 @example
42 keycode 109 = Hyper_R
43 add mod3 = Hyper_R
44 @end example
45
46 after that @code{xev} should report that keycode 109 have corresponded
47 Hyper_R keysym.
48
49 Now it is time to modify a little your @code{~/.xinitrc}.  Who will be
50 your window manager?  Of course your guess about XEmacs is correct.  So
51 instead of running for example afterstep or fvwm you need to run XEmacs.
52 Part of your @code{~/.xinitrc} should looks like:
53
54 @example
55 # exec afterstep
56 exec xemacs
57 @end example
58
59 You should run @code{xinit}, or @code{startx} with -tcp-listen option,
60 otherwise xlib will not be able to connect to X server.
61
62 @node Configuring Emacs, Configuring XWEM, Configuring X, Getting Started
63 @comment  node-name,  next,  previous,  up
64 @section Configuring Emacs
65 @cindex configuring
66
67 Now we are almost ready to run XWEM.  Add something like
68 @example
69 (add-to-list 'load-path (expand-file-name "/path/to/xwem"))
70 (require 'xwem-load)
71 (xwem-init)
72 @end example
73 at the end of your @code{~/.emacs}
74
75 TODO: write how you need to configure emacs, i.e. what to need to add in
76 @code{~/.emacs}.
77
78 @node Configuring XWEM, , Configuring Emacs, Getting Started
79 @comment  node-name,  next,  previous,  up
80 @section Configuring XWEM
81 @cindex configuring
82
83 You can configure any of XWEM's subroutines using
84 @code{~/.xwem/xwemrc.el} file.  It will be evaluated at the top of
85 @var{xwem-init} function.
86
87 Here is example of what you can do:
88
89 @example
90 (setq X-use-queryfont t)                ; speeds up things
91
92 ;; We can recreate emacs frame, so there is no problems in deleting
93 ;; last frame.
94 (setq allow-deletion-of-last-visible-frame t)
95
96 (setq special-display-frame-plist
97       (plist-put special-display-frame-plist 'height 50))
98
99 (defadvice kill-buffer (before delete-dedicated-frame activate)
100   "Work around dedicated frame problem."
101   (let ((frame (buffer-dedicated-frame
102                 (get-buffer (or (ad-get-arg 0) (current-buffer))))))
103     (when (framep frame)
104       (delete-frame frame))))
105
106 ;; Icons
107 ;(setq xwem-icons-dir "~/prog/emacs/xwem/icons")
108 (pushnew '([".*freebsd.*" "xterm" "XTerm"] . "mini-daemon.xpm")
109    xwem-icons-alist)
110 (pushnew '([".*xwem.*" "emacs" "Emacs"] . "mini-xwem.xpm")
111    xwem-icons-alist)
112
113 ;;; Customize XWEM variables
114 (setq xwem-minibuffer-active-border-color "cyan2"
115       xwem-default-focus-mode 'follow-mouse
116       xwem-edmacro-can-edit-nonmacro t
117       )
118
119 (define-abbrev-table 'xwem-launcher-abbrev-table
120   '(("gterm" "xterm -fg green -hc green4" nil 0)
121     ("gfterm" "xterm -fg green -hc green4 -fn fixed" nil 0)
122     ("aqterm" "xterm -fg aquamarine -hc aquamarine4" nil 0)
123     ("aqfterm" "xterm -fg aqua -hc aqua4 -fn fixed" nil 0)
124     ("gsterm" "xterm -fg darkseagreen1 -hc darkseagreen4" nil 0)
125     ("gsfterm"
126      "xterm -fg darkseagreen1 -hc darkseagreen4 -fn fixed" nil 0)
127     ("oterm" "xterm -fg OliveDrab1 -hc OliveDrab4" nil 0)
128     ("ofterm" "xterm -fg OliveDrab1 -hc OliveDrab4 -fn fixed" nil 0)
129     ("orterm" "xterm -fg orange -hc orange4" nil 0)
130     ("orfterm" "xterm -fg orange -hc orange4 -fn fixed" nil 0)
131     ))
132   
133 ;; Add sounds, beeping type
134 (xwem-sound-load-default t)
135
136 ;;; Addons
137
138 ;; Buqis like client switcher
139 (xwem-clswi-enable)
140
141 ;; `display-time' like stuff in system tray
142 ;(add-hook 'xwem-after-init-hook 'xwem-time)
143
144 ;; H-6, H-x /, H-x j bindings
145 (require 'xwem-register)
146 (xwem-register-install-bindings)
147
148 ;; Nice frame indicator
149 (autoload 'xwem-framei-init "xwem-framei")
150 (add-hook 'xwem-after-init-hook 'xwem-framei-init)
151
152 ;; Making holer in frames
153 (require 'xwem-holer)
154 (define-key xwem-global-map (xwem-kbd "H-x h") 'xwem-holer-prefix)
155
156 ;; Nice rooter addon
157 (require 'xwem-rooter)
158 (xwem-rooter-add-client 'xwem-xclock-onroot "^xclock$")
159 (xwem-rooter-add-client 'xwem-gkrellm-onroot "^gkrellm$")
160
161 ;; Worklog
162 (require 'xwem-worklog)
163 (define-key xwem-global-map (xwem-kbd "H-w") 'xwem-worklog-prefix)
164
165 ;; Fast frame switcher
166 (defun my-xwem-switch-frame (key)
167   "To be used by H-C-<digit> bindings."
168   (interactive (list (event-key xwem-last-event)))
169   (xwem-frame-switch-nth (- (char-to-int key) 48)))
170
171 (define-key xwem-global-map (xwem-kbd "H-C-0") 'my-xwem-switch-frame)
172 (define-key xwem-global-map (xwem-kbd "H-C-1") 'my-xwem-switch-frame)
173 (define-key xwem-global-map (xwem-kbd "H-C-2") 'my-xwem-switch-frame)
174 (define-key xwem-global-map (xwem-kbd "H-C-3") 'my-xwem-switch-frame)
175 (define-key xwem-global-map (xwem-kbd "H-C-4") 'my-xwem-switch-frame)
176 (define-key xwem-global-map (xwem-kbd "H-C-5") 'my-xwem-switch-frame)
177 (define-key xwem-global-map (xwem-kbd "H-C-6") 'my-xwem-switch-frame)
178 (define-key xwem-global-map (xwem-kbd "H-C-7") 'my-xwem-switch-frame)
179 (define-key xwem-global-map (xwem-kbd "H-C-8") 'my-xwem-switch-frame)
180 (define-key xwem-global-map (xwem-kbd "H-C-9") 'my-xwem-switch-frame)
181
182 @end example
183
184 TODO: write me