3 (require 'rep.io.timers)
7 (require 'jump-or-exec)
8 (bind-keys global-keymap
9 "H-i" `(jump-or-exec "GVIM"
13 (display-window wind))))
14 (bind-keys global-keymap
15 "H-y" `(jump-or-exec "^.*@.*:.*$"
19 (display-window wind))))
20 (bind-keys global-keymap
21 "H-z" `(jump-or-exec "Mozilla"
23 (system "/usr/local/firefox/firefox &"))
25 (display-window wind))))
26 (bind-keys global-keymap
27 "H-m" `(jump-or-exec "emelFM2"
31 (display-window wind))))
33 (define-match-window-setter 'keymap-trans
34 (lambda (w prop value)
35 (declare (unused prop))
36 (let ((keymap (or (window-get w 'keymap)
37 (window-put w 'keymap (copy-sequence window-keymap)))))
39 (lambda (pair) ; pair of from and to keys
42 (lambda () (interactive)
44 (if (string-match (cadr pair) (window-name w))
45 (synthesize-event (lookup-event (caddr pair)) (input-focus))
47 ;(if (string-match (cadr pair) "shell")
48 ;(delete-window-safely w)
52 (if (string-match (cadddr pair) (window-name w))
53 (synthesize-event (lookup-event (car(cddddr pair))) (input-focus)
60 (if (string-match (cadr(cddddr pair)) (window-name w))
61 (synthesize-event (lookup-event (caddr(cddddr pair))) (input-focus)
71 ;(add-window-matcher 'WM_CLASS "^Gvim/gvim$"
72 ;'(keymap-trans . (("C-SPC" ".*GVIM.*i.* " "F2" ".*GVIM.*" "C-SPC")
73 ;("ESC" ".*GVIM.*i c" "C-SPC" ".*GVIM.*i.* D" "F12" ".*GVIM.*" "ESC")
74 ;("i" ".*GVIM.*" "i" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
75 ;("o" ".*GVIM.*" "o" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
76 ;("a" ".*GVIM.*" "a" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
77 ;("C" ".*GVIM.*" "C" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
78 ;("O" ".*GVIM.*" "O" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
79 ;("I" ".*GVIM.*" "I" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
80 ;("$" ".*GVIM.*" "$" ".*GVIM.*i c U" "C-SPC" ".*GVIM.*i.* U" "F12")
83 ;(add-window-matcher 'WM_NAME "^View Items$"
84 ;'(keymap-trans . (("x" "shell" "delete-window-safely" "test"))))
85 (add-window-matcher 'WM_CLASS "^emelfm2/main$"
86 '(keymap-trans . (("C-/" ".*emelFM2.*" "." ".*emelFM2.*" "BS"))))
87 ;(add-window-matcher 'WM_CLASS "^Gvim/gvim$"
88 ;'(keymap-trans . (("esc" "esc" "C-SPC"))))
89 ;(add-window-matcher 'WM_NAME "*GVIM* i c$"
90 ;'(keymap-trans . (("C-SPC" "C-F2") )))
91 ;(add-window-matcher 'WM_CLASS "^Firefox-bin/Gecko$"
92 ;'(keymap-trans . (("H-j" "Down") ("H-k" "Up"))))
93 ;(add-window-matcher 'WM_CLASS "*"
94 ;'(keymap-trans . (("H-j" "Down") ("H-k" "Up"))))
96 ;(require 'switch-viewports)
97 ;(bind-keys global-keymap "M-C-j" 'switch-viewport-up)
99 ;(require 'viewport-scrolling)
100 ;(bind-keys global-keymap "M-C-j" 'scroll-viewport-up)
102 ;(bind-keys window-keymap "C-M-j" 'pack-window-down)
103 ;(bind-keys window-keymap "C-M-k" 'pack-window-up)
104 ;(bind-keys window-keymap "C-M-h" 'pack-window-left)
105 ;(bind-keys window-keymap "C-M-l" 'pack-window-right)
107 ;(set-number-of-workspaces 2)
109 ;(define-special-variable viewport-dimensions '(2 . 2)
110 ; "Size of each virtual workspace.")
112 ;(define-special-variable uniconify-to-current-viewport t
113 ;"Windows uniconify to the current viewport.")
115 ;(define-special-variable workspace-boundary-mode 'stop
116 ;"How to act when passing the first or last workspace, one of
117 ;`stop', `wrap-around' or `keep-going'")
119 ;(define-special-variable edge-flip-type 'viewport
120 ; "Control what hitting the screen edge selects, workspace or viewport.")
122 ;(define-special-variable customize-command-classes '(viewport default)
123 ;"Also include commands of these classes the key bindings panel.
124 ;Add the `viewport' keyboard to make viewport commands show up.")
126 ;(bind-keys global-keymap "H-j" 'move-viewport-down)
127 ;(bind-keys global-keymap "H-k" 'move-viewport-up)
128 ;(bind-keys global-keymap "H-h" 'move-viewport-left)
129 ;(bind-keys global-keymap "H-l" 'move-viewport-right)
131 ;(bind-keys global-keymap "M-H-j" 'move-window-down)
132 ;(bind-keys global-keymap "M-H-k" 'move-window-up)
133 ;(bind-keys global-keymap "M-H-h" 'move-window-left)
134 ;(bind-keys global-keymap "M-H-l" 'move-window-right)
136 (bind-keys global-keymap "M-C-y" 'restart)
139 ;(bind-keys global-keymap "H-p" '(system "sh ~/bin/chang-proxy.sh &"))
141 (bind-keys global-keymap "H-v" '(system "gvim -f &"))
143 ;(bind-keys global-keymap "H-q" '(system "/etc/acpi/hibernate.sh &"))
148 (defun wy-construct-arg-list (str sep)
149 "Construct a list from a string. Using sep as separetor."
154 (setq result (cons x result)))))
158 (setq nextchar (substring left 0 1))
162 (string-match "\\s" nextchar)
166 ((= (+ 1 ptr) (length str))
167 (setq s (concat s nextchar))
168 (if (> (length s) 0) (add-to-the-list s))
171 (setq s (concat s nextchar))))
172 (loop s (substring left 1) (+ ptr 1))))
176 (defun wy-start-entry (prog-entry)
178 (let ((process (make-process standard-output))
179 (prog-entry-list (wy-construct-arg-list prog-entry "\\s")))
180 (apply start-process process (car prog-entry-list) (cdr prog-entry-list))))
182 (setq startup-programs
185 (mapc wy-start-up startup-programs)
187 (defun wy-cleanup-on-exit ()
188 (mapc stop-process (active-processes)))
190 (add-hook 'after-initialization-hook 'wy-start-up)
191 (add-hook 'before-exit-hook 'wy-cleanup-on-exit)