-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstumpwmrc
211 lines (166 loc) · 7.43 KB
/
stumpwmrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
;; -*-lisp-*-
;;
;; Here is a sample .stumpwmrc file
(in-package :stumpwm)
;; change the prefix key to something else
(set-prefix-key (kbd "s-SPC"))
(ql:quickload "clx-truetype")
(clx-truetype:cache-fonts)
(load-module "ttf-fonts")
(load-module "battery-portable")
(load-module "wifi")
(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 32))
(ql:quickload "xembed")
(load-module "stumptray")
(defmacro multiple-define-in-map (map &body defs)
(append
'(progn)
(loop for d in defs collect
`(define-key ,map ,(car d) ,(cadr d)))))
(defcommand chrome () ()
"run chrome"
(run-or-raise "exec google-chrome" '(:class "Google-chrome")))
(defcommand intellij () ()
"run intellij"
(run-or-raise "exec idea" '(:class "jetbrains-idea-ce")))
(defcommand pycharm () ()
"run pycharm"
(run-or-raise "exec pycharm" '(:class "jetbrains-pycharm")))
(defcommand slack () ()
"run slack"
(run-or-raise "exec slack" '(:class "Slack")))
(multiple-define-in-map *top-map*
((kbd "s-0") "select-window-by-number 0")
((kbd "s-1") "select-window-by-number 1")
((kbd "s-2") "select-window-by-number 2")
((kbd "s-3") "select-window-by-number 3")
((kbd "s-4") "select-window-by-number 4")
((kbd "s-5") "select-window-by-number 5")
((kbd "s-6") "select-window-by-number 6")
((kbd "s-7") "select-window-by-number 7")
((kbd "s-8") "select-window-by-number 8")
((kbd "s-9") "select-window-by-number 9")
((kbd "s-l") "move-focus right")
((kbd "s-h") "move-focus left")
((kbd "s-j") "move-focus down")
((kbd "s-k") "move-focus up")
((kbd "s-L") "move-window right")
((kbd "s-H") "move-window left")
((kbd "s-J") "move-window down")
((kbd "s-K") "move-window up")
((kbd "s-Right") "move-focus right")
((kbd "s-Left") "move-focus left")
((kbd "s-Down") "move-focus down")
((kbd "s-Up") "move-focus up")
((kbd "S-s-Right") "move-window right")
((kbd "S-s-Left") "move-window left")
((kbd "S-s-Down") "move-window down")
((kbd "S-s-Up") "move-window up")
((kbd "s-e") "emacs")
((kbd "s-i") "chrome")
((kbd "s-j") "intellij")
((kbd "s-p") "pycharm")
((kbd "s-s") "slack")
((kbd "s-c") "exec urxvt")
((kbd "s-Tab") "windowlist"))
(multiple-define-in-map *root-map*
((kbd "b") "select")
((kbd "m") "mode-line")
((kbd "Tab") "windowlist")
((kbd "c") "exec urxvt"))
(setf *window-format* "%m%n%s%c")
(setf *screen-mode-line-format* (list "[^B%n^b] %W^>%d [%B][%I]"))
(setf *time-modeline-string* "%a %b %e %k:%M")
(setf *mode-line-timeout* 2)
(defcommand tesco-prod () () "tesco prod shell" (run-shell-command "~/keyshells/tesco/prod"))
(defcommand tesco-staging () () "tesco staging shell" (run-shell-command "~/keyshells/tesco/staging"))
(defcommand tesco-uat () () "tesco uat shell" (run-shell-command "~/keyshells/tesco/uat"))
(defcommand setup-screens () () "setup screens" (run-shell-command "~/bin/setup-screens"))
(defcommand reset-screens () () "reset screens" (run-shell-command "~/bin/reset-screens"))
(defcommand lsm-prod () () "lsm
prod shell" (run-shell-command "~/keyshells/lsm/prod"))
(defcommand seft-prod () () "seft prod shell" (run-shell-command "~/keyshells/seft/prod"))
(defcommand seft-staging () () "seft staging shell" (run-shell-command "~/keyshells/seft/staging"))
(defcommand acca-prod () () "acca prod shell" (run-shell-command "~/keyshells/acca/prod"))
(defcommand acca-oat () () "acca oat shell" (run-shell-command "~/keyshells/acca/oat"))
(defcommand acca-uat () () "acca uat shell" (run-shell-command "~/keyshells/acca/uat"))
(defcommand acca-sys () () "acca sys shell" (run-shell-command "~/keyshells/acca/sys"))
(defcommand acca-dev () () "acca dev shell" (run-shell-command "~/keyshells/acca/dev"))
(defcommand rdg-portal-prod () () "rdg portal prod shell" (run-shell-command "~/keyshells/rdg/portal/prod"))
(defcommand rdg-portal-lvtst () () "rdg portal lvtst shell" (run-shell-command "~/keyshells/rdg/portal/lvtst"))
(defcommand rdg-portal-preprod () () "rdg portal preprod shell" (run-shell-command "~/keyshells/rdg/portal/preprod"))
(defcommand rdg-common-services-prod () () "rdg common services prod shell" (run-shell-command "~/keyshells/rdg/common-services/prod"))
(defcommand rdg-common-services-test () () "rdg common services test shell" (run-shell-command "~/keyshells/rdg/common-services/test"))
(defcommand screensaver () () "run screensaver" (run-shell-command "~/bin/screensaver"))
(multiple-define-in-map *top-map*
((kbd "s-F11") "setup-screens")
((kbd "s-F12") "reset-screens")
((kbd "s-\\") "screensaver")
)
;; prompt the user for an interactive command. The first arg is an
;; optional initial contents.
(defcommand colon1 (&optional (initial "")) (:rest)
(let ((cmd (read-one-line (current-screen) ": " :initial-input initial)))
(when cmd
(eval-command cmd t))))
(setf *window-border-style* 'thin)
(setf *mouse-focus-policy* :click)
;; Read some doc
(define-key *root-map* (kbd "d") "exec gv")
;; Browse somewhere
;; (define-key *root-map* (kbd "b") "colon1 exec firefox http://www.")
;; Ssh somewhere
(define-key *root-map* (kbd "C-s") "colon1 exec xterm -e ssh ")
;; Lock screen
(define-key *root-map* (kbd "C-l") "exec xlock")
;; Web jump (works for Google and Imdb)
;; (defmacro make-web-jump (name prefix)
;; `(defcommand ,name (search) ((:rest ,(concatenate 'string name " search: ")))
;; (substitute #\+ #\Space search)
;; (run-shell-command (concatenate 'string ,prefix search))))
;; (make-web-jump "google" "firefox http://www.google.fr/search?q=")
;; (make-web-jump "imdb" "firefox http://www.imdb.com/find?q=")
;; ;; C-t M-s is a terrble binding, but you get the idea.
;; (define-key *root-map* (kbd "M-s") "google")
;; (define-key *root-map* (kbd "i") "imdb")
;; Message window font
;;; Define window placement policy...
;; Clear rules
(clear-window-placement-rules)
;; Last rule to match takes precedence!
;; TIP: if the argument to :title or :role begins with an ellipsis, a substring
;; match is performed.
;; TIP: if the :create flag is set then a missing group will be created and
;; restored from *data-dir*/create file.
;; TIP: if the :restore flag is set then group dump is restored even for an
;; existing group using *data-dir*/restore file.
(define-frame-preference "Default"
;; frame raise lock (lock AND raise == jumpto)
(0 t nil :class "Konqueror" :role "...konqueror-mainwindow")
(1 t nil :class "XTerm"))
(define-frame-preference "Ardour"
(0 t t :instance "ardour_editor" :type :normal)
(0 t t :title "Ardour - Session Control")
(0 nil nil :class "XTerm")
(1 t nil :type :normal)
(1 t t :instance "ardour_mixer")
(2 t t :instance "jvmetro")
(1 t t :instance "qjackctl")
(3 t t :instance "qjackctl" :role "qjackctlMainForm"))
(define-frame-preference "Shareland"
(0 t nil :class "XTerm")
(1 nil t :class "aMule"))
(defun focus-java-window (curr last)
(pushnew :WM_TAKE_FOCUS (xlib:wm-protocols (window-xwin curr)))
(xlib:set-input-focus *display* (window-xwin curr) :none))
(add-hook *focus-window-hook* 'focus-java-window)
(remove-hook *focus-window-hook* 'focus-java-window)
;;; stuff that can break goes at the end, so that the main config
;;; doesn't die
#(ql:quickload "swank")
;; (swank:create-server :port 1389)
#(run-shell-command "/usr/bin/stalonetray &")
#(run-shell-command "gnome-power-manager &")
#(run-shell-command "nm-applet &")
#(run-shell-command "dropbox start &")
#(stumptray::stumptray)