[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2. Getting Started

You must provide some effort in way to make XWEM usable. Configuring XWEM splits to three tasks:

2.1 Configuring X  How to configure X server.
2.2 Configuring Emacs  What you need in ~/.emacs to run XWEM.
2.3 Configuring XWEM  How to configure XWEM.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.1 Configuring X

First off all we need to configure keyboard to obtain control over XWEM. XWEM expects that there is Hyper key setuped on your keyboard and that Hyper key acts as modifier(i.e. in X's modifiers list). Hyper key for XWEM is like Meta key for XEmacs. All default commands in XWEM uses Hyper. But it is not necessary to use Hyper key, but recommended. You can control which modifier to use by xwem-hyper-modifier variable which default value is hyper.

There is two ways to configure Hyper key. One is using XKB X extension and the other(easier) is using xmodmap application. Find a key(keycode) to which you want bind Hyper, using xev(1) utility. Consider it is value 109.

$ xmodmap -e "keycode 109 = Hyper_R"
$ xmodmap -e "add mod3 = Hyper_R"

or add following to your ~/.Xmodmap(or whatever):

keycode 109 = Hyper_R
add mod3 = Hyper_R

after that xev should report that keycode 109 have corresponded Hyper_R keysym.

Now it is time to modify a little your ~/.xinitrc. Who will be your window manager? Of course your guess about XEmacs is correct. So instead of running for example afterstep or fvwm you need to run XEmacs. Part of your ~/.xinitrc should looks like:

# exec afterstep
exec xemacs

You should run xinit, or startx with -tcp-listen option, otherwise xlib will not be able to connect to X server.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.2 Configuring Emacs

Now we are almost ready to run XWEM. Add something like

(add-to-list 'load-path (expand-file-name "/path/to/xwem"))
(require 'xwem-load)
at the end of your ~/.emacs

TODO: write how you need to configure emacs, i.e. what to need to add in ~/.emacs.

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

2.3 Configuring XWEM

You can configure any of XWEM's subroutines using ~/.xwem/xwemrc.el file. It will be evaluated at the top of xwem-init function.

Here is example of what you can do:

(setq X-use-queryfont t)		; speeds up things

;; We can recreate emacs frame, so there is no problems in deleting
;; last frame.
(setq allow-deletion-of-last-visible-frame t)

(setq special-display-frame-plist
      (plist-put special-display-frame-plist 'height 50))

(defadvice kill-buffer (before delete-dedicated-frame activate)
  "Work around dedicated frame problem."
  (let ((frame (buffer-dedicated-frame
                (get-buffer (or (ad-get-arg 0) (current-buffer))))))
    (when (framep frame)
      (delete-frame frame))))

;; Icons
;(setq xwem-icons-dir "~/prog/emacs/xwem/icons")
(pushnew '([".*freebsd.*" "xterm" "XTerm"] . "mini-daemon.xpm")
(pushnew '([".*xwem.*" "emacs" "Emacs"] . "mini-xwem.xpm")

;;; Customize XWEM variables
(setq xwem-minibuffer-active-border-color "cyan2"
      xwem-default-focus-mode 'follow-mouse
      xwem-edmacro-can-edit-nonmacro t

(define-abbrev-table 'xwem-launcher-abbrev-table
  '(("gterm" "xterm -fg green -hc green4" nil 0)
    ("gfterm" "xterm -fg green -hc green4 -fn fixed" nil 0)
    ("aqterm" "xterm -fg aquamarine -hc aquamarine4" nil 0)
    ("aqfterm" "xterm -fg aqua -hc aqua4 -fn fixed" nil 0)
    ("gsterm" "xterm -fg darkseagreen1 -hc darkseagreen4" nil 0)
     "xterm -fg darkseagreen1 -hc darkseagreen4 -fn fixed" nil 0)
    ("oterm" "xterm -fg OliveDrab1 -hc OliveDrab4" nil 0)
    ("ofterm" "xterm -fg OliveDrab1 -hc OliveDrab4 -fn fixed" nil 0)
    ("orterm" "xterm -fg orange -hc orange4" nil 0)
    ("orfterm" "xterm -fg orange -hc orange4 -fn fixed" nil 0)
;; Add sounds, beeping type
(xwem-sound-load-default t)

;;; Addons

;; Buqis like client switcher

;; `display-time' like stuff in system tray
;(add-hook 'xwem-after-init-hook 'xwem-time)

;; H-6, H-x /, H-x j bindings
(require 'xwem-register)

;; Nice frame indicator
(autoload 'xwem-framei-init "xwem-framei")
(add-hook 'xwem-after-init-hook 'xwem-framei-init)

;; Making holer in frames
(require 'xwem-holer)
(define-key xwem-global-map (xwem-kbd "H-x h") 'xwem-holer-prefix)

;; Nice rooter addon
(require 'xwem-rooter)
(xwem-rooter-add-client 'xwem-xclock-onroot "^xclock$")
(xwem-rooter-add-client 'xwem-gkrellm-onroot "^gkrellm$")

;; Worklog
(require 'xwem-worklog)
(define-key xwem-global-map (xwem-kbd "H-w") 'xwem-worklog-prefix)

;; Fast frame switcher
(defun my-xwem-switch-frame (key)
  "To be used by H-C-<digit> bindings."
  (interactive (list (event-key xwem-last-event)))
  (xwem-frame-switch-nth (- (char-to-int key) 48)))

(define-key xwem-global-map (xwem-kbd "H-C-0") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-1") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-2") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-3") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-4") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-5") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-6") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-7") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-8") 'my-xwem-switch-frame)
(define-key xwem-global-map (xwem-kbd "H-C-9") 'my-xwem-switch-frame)

TODO: write me

[ << ] [ >> ]           [Top] [Contents] [Index] [ ? ]

This document was generated by XEmacs Webmaster on October, 2 2007 using texi2html