Location: lg@xxxxxxxxxxxxxx http://arch.xwem.org/2005/
Revision: xwem--main--2.1--patch-35
Archive: lg@xxxxxxxxxxxxxx
Creator: Zajcev Evgeny <lg@xxxxxxxx>
Date: Sun Mar 20 00:46:44 MSK 2005
Standard-date: 2005-03-19 21:46:44 GMT
Modified-files: extra/xwem-mogu.el lisp/xwem-focus.el
lisp/xwem-frame.el lisp/xwem-icons.el
lisp/xwem-manage.el
New-patches: lg@xxxxxxxxxxxxxx/xwem--main--2.1--patch-35
Summary: fixes, addons
Keywords: frame, matching, icons
* lisp/xwem-manage.el (xwem-applications-alist): Little
restructurisation.
* lisp/xwem-manage.el (xwem-cl-match-p): [addon] new type for matching -
`property'. So for example to match client which has 2 pixels width
border use something like:
(xwem-cl-match-cl cl '((property (x-border-width . 2))))
* lisp/xwem-focus.el (bottom): Trailing space removed in minor mode name.
* lisp/xwem-frame.el (xwem-make-frame-1): [addon] Support for
ParentRelative background. To try out what parent relative background
is - remove 'background property from `xwem-frame-default-properties'
and create new frame:
(plist-remprop xwem-frame-default-properties 'background)
(xwem-make-frame 'desktop)
* lisp/xwem-icons.el (xwem-icons-list): [addon] rxvt added.
* extra/xwem-mogu.el (xwem-mogu-minor-mode): Initial changes to make mogu
be minor mode (not checked, might not work yet).
* added files
{arch}/xwem/xwem--main/xwem--main--2.1/lg@xxxxxxxxxxxxxx/patch-log/patch-35
* modified files
--- orig/extra/xwem-mogu.el
+++ mod/extra/xwem-mogu.el
@@ -130,6 +130,19 @@
:group 'xwem-mogu
:group 'xwem-faces)
+(defcustom xwem-mogu-minor-mode-hook nil
+ "Hooks to run when mogu mode is enabled or disabled.
+When running hooks value of `xwem-mogu-minor-mode' is non-nil when
+mogu minor mode is enabling.
+When running hooks value of `xwem-mogu-minor-mode' is nil when mogu
+minor mode is disabling."
+ :type 'hook
+ :group 'xwem-hooks
+ :group 'xwem-mogu)
+
+(defvar xwem-mogu-minor-mode nil
+ "Non-nil mean mogu minor mode is enabled.")
+
(defvar xwem-mogu-xwin nil)
@@ -220,6 +233,34 @@
;;; Commands:
+(define-xwem-command xwem-turn-on-mogu ()
+ "Enable mogu minor mode."
+ (xwem-interactive)
+ (unless xwem-mogu-minor-mode
+ (if xwem-mogu-xwin
+ (XMapWindow (xwem-dpy) xwem-mogu-xwin)
+ (xwem-mogu-create-grid))
+ (xwem-turn-on-minor-mode nil 'xwem-mogu-minor-mode)
+ (run-hooks 'xwem-mogu-minor-mode-hook)))
+
+(define-xwem-command xwem-turn-off-mogu ()
+ "Disable mogu minor mode."
+ (xwem-interactive)
+ (when xwem-mogu-minor-mode
+ (XUnmapWindow (xwem-dpy) xwem-mogu-xwin)
+ (xwem-turn-off-minor-mode nil 'xwem-mogu-minor-mode)
+ (run-hooks 'xwem-mogu-minor-mode-hook)))
+
+(define-xwem-command xwem-mogu-minor-mode (arg)
+ "Toggle mogu minor mode.
+If ARG is positive number - enable it.
+If ARG is negative number - disable it."
+ (xwem-interactive "P")
+ (if (or (and (numberp arg)
+ (> arg 0))
+ (not xwem-mogu-minor-mode))
+ (xwem-turn-on-mogu)
+ (xwem-turn-off-mogu)))
(defun xwem-mogu-goto (id-x id-y)
"Move to node with ID."
@@ -320,4 +361,7 @@
(provide 'xwem-mogu)
+;;; On-load actians
+(xwem-add-minor-mode 'xwem-mogu-minor-mode "Mogu")
+
;;; xwem-mogu.el ends here
--- orig/lisp/xwem-focus.el
+++ mod/lisp/xwem-focus.el
@@ -278,7 +278,7 @@
(xwem-turn-off-focus-click-mode cl))))
;; Register minor mode
-(xwem-add-minor-mode 'xwem-focus-click-minor-mode "Click "
+(xwem-add-minor-mode 'xwem-focus-click-minor-mode "Click"
'xwem-focus-click-to-focus-map)
--- orig/lisp/xwem-frame.el
+++ mod/lisp/xwem-frame.el
@@ -520,6 +520,9 @@
(make-X-Attr :override-redirect
(not (xwem-frame-embedded-p frame))
:backing-store nil
+ :background-pixmap
+ (unless (xwem-frame-embedded-p frame)
+ X-ParentRelative)
:cursor xwem-frame-cursor
:event-mask xwem-frame-ev-mask)))
(X-Win-put-prop fwin 'xwem-frame frame)
--- orig/lisp/xwem-icons.el
+++ mod/lisp/xwem-icons.el
@@ -132,7 +132,9 @@
(name "[LlMmVv][Ii][Cc][Qq]")))
;; xterm
- ("mini-term.xpm" (class-inst ".term") (class-name ".[tT]erm"))
+ ("mini-term.xpm" (and (class-name "^.[tT]erm$")
+ (or (class-inst "^.term$")
+ (class-inst "^rxvt$"))))
("mini-x2.xpm" (eval t))) ; any other
"Icons matching list in `xwem-manage-list' format."
--- orig/lisp/xwem-manage.el
+++ mod/lisp/xwem-manage.el
@@ -116,18 +116,10 @@
(class-name "^XTerm$")))
("xdvi" (and (class-inst "^xdvi$")
(class-name "^XDvi$")))
- ("xpdf" (class-name "^Xpdf$"))
- ("xchm" (name "^xCHM"))
- ("acroread" (class-name "^AcroRead$"))
("djview" (and (class-inst "^djview$")
(class-name "^Djview$")))
- ("mozilla" (or (class-name "^[mM]ozilla")
- (class-inst "^[mM]ozilla")))
- ("firefox" (class-name "^Firefox"))
- ("opera" (class-name "^Opera$"))
("rdesktop" (and (class-inst "^rdesktop$")
(class-name "^rdesktop$")))
- ("ddd" (class-name "^Ddd$"))
("vncviewer" (and (class-inst "^vncviewer$")
(class-name "^Vncviewer$")))
("display" (and (class-inst "^display$")
@@ -144,7 +136,6 @@
(class-name "^XKeyCaps$")))
("gimp_startup" (and (class-inst "^gimp_startup$")
(class-name "^Gimp$")))
- ("gimp" (class-name "^Gimp$"))
("gv" (and (class-inst "^gv$")
(class-name "^GV$")))
("ghostview" (and (class-inst "^ghostview$")
@@ -153,14 +144,11 @@
(class-name "^Xfd$")))
("xfontsel" (and (class-inst "^xfontsel$")
(class-name "^XFontSel$")))
- ("xchat" (class-name "^X-Chat$"))
("gnumeric" (and (class-inst "^gnumeric$")
(class-name "^Gnumeric$")))
- ("gnuplot" (name "^Gnuplot$"))
("ethereal" (and (class-inst "^ethereal$")
(class-name "^Ethereal$")))
- ("xmms" (class-name "^[Xx]mms$"))
("gkrellm" (and (class-inst "gkrellm")
(class-name "Gkrellm")))
;; Gdesklets stuff
@@ -173,6 +161,24 @@
(class-name "^Links$")))
("licq" (and (class-inst "^licq$")
(class-name "^Licq$")))
+
+ ;; CLASS-NAME only
+ ("mozilla" (or (class-name "^[mM]ozilla")
+ (class-inst "^[mM]ozilla")))
+ ("xmms" (class-name "^[Xx]mms$"))
+ ("xine" (class-name "^xine$"))
+ ("mplayer" (class-name "^MPlayer$"))
+ ("xchat" (class-name "^X-Chat$"))
+ ("gimp" (class-name "^Gimp$"))
+ ("ddd" (class-name "^Ddd$"))
+ ("firefox" (class-name "^Firefox"))
+ ("opera" (class-name "^Opera$"))
+ ("xpdf" (class-name "^Xpdf$"))
+ ("acroread" (class-name "^AcroRead$"))
+
+ ;; NAME only
+ ("gnuplot" (name "^Gnuplot$"))
+ ("xchm" (name "^xCHM"))
)
"Alist of known applications.
CAR is appllication name, CDR is match-spec.
@@ -246,6 +252,9 @@
`command' - Client's WM_COMMAND (PARAM is regex)
+ `property' - PARAM is either property symbol, or cons cell where car
+ is property symbol and cdr is value of property to match.
+
`function' - PARAM is function which passed with one argument CL and
returns non-nil if CL matches.
@@ -303,6 +312,14 @@
(and (xwem-cl-p cl)
(or (null param)
(string-match param (or
(xwem-hints-wm-command (or hints (setq hints (xwem-cl-hints cl)))) "")))))
+ ((eq type 'property)
+ (and (xwem-cl-p cl)
+ (cond ((symbolp param)
+ (xwem-client-property cl param))
+ ((and (consp param)
+ (symbolp (car param)))
+ (equal (xwem-client-property cl (car
param))
+ (cdr param))))))
((eq type 'application)
(and (xwem-cl-p cl)
(xwem-cl-match-p cl (cdr (assoc param
xwem-applications-alist)))))
|