summaryrefslogtreecommitdiff
path: root/init.scm
blob: 8f3d0239e743ed9caad375375cdda0b5efe40359 (about) (plain)
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
(use-modules (wm))

(define config
  (make-config
   ;; Border sizes
   2    ; inner-border-width
   0    ; outer-border-width
   16   ; magnet-border-width
   ;; Margins
   0    ; offset-x
   0    ; offset-y
   0    ; offset-width
   0    ; offset-height
   ;; Colors
   "#35586c" ; focused-color
   "#333333" ; unfocused-color
   "#ff6666" ; unkillable-color
   "#000000" ; empty-color
   "#0d131a" ; outer-color
   ))

(define (make-callback proc arg)
  (lambda () (proc arg)))

(define wm-keybindings
  `((,(make-shift-key "q") . ,wm-quit)
    (,(make-key "q") . ,wm-focus-close)
    ;; Focus
    (,(make-key       "Tab") . ,wm-focus-prev)
    (,(make-shift-key "Tab") . ,wm-focus-next)
    (,(make-key "k") . ,wm-focus-prev)
    (,(make-key "j") . ,wm-focus-next)
    ;; Packing
    (,(make-shift-key "Left")  . ,wm-pack-left)
    (,(make-shift-key "Right") . ,wm-pack-left)
    (,(make-shift-key "Up")    . ,wm-pack-top)
    (,(make-shift-key "Down")  . ,wm-pack-bottom)
    ;; Toggle between normal and tiled in a certain position
    (,(make-key "s")     . ,wm-toggle-maximize)
    (,(make-key "a")     . ,wm-toggle-half-left)
    (,(make-key "Left")  . ,wm-toggle-half-left)
    (,(make-key "d")     . ,wm-toggle-half-right)
    (,(make-key "Right") . ,wm-toggle-half-right)
    (,(make-key "w")     . ,wm-toggle-half-top)
    (,(make-key "Up")    . ,wm-toggle-half-top)
    (,(make-key "x")     . ,wm-toggle-half-bottom)
    (,(make-key "Down")  . ,wm-toggle-half-bottom)
    (,(make-key "q")     . ,wm-toggle-top-left)
    (,(make-key "e")     . ,wm-toggle-top-right)
    (,(make-key "z")     . ,wm-toggle-bottom-left)
    (,(make-key "c")     . ,wm-toggle-bottom-right)
    ;; Set current workspace
    (,(make-key "1") . ,(make-callback wm-set-workspace 1))
    (,(make-key "2") . ,(make-callback wm-set-workspace 2))
    (,(make-key "3") . ,(make-callback wm-set-workspace 3))
    (,(make-key "4") . ,(make-callback wm-set-workspace 4))
    (,(make-key "5") . ,(make-callback wm-set-workspace 5))
    (,(make-key "6") . ,(make-callback wm-set-workspace 6))
    (,(make-key "7") . ,(make-callback wm-set-workspace 7))
    (,(make-key "8") . ,(make-callback wm-set-workspace 8))
    (,(make-key "9") . ,(make-callback wm-set-workspace 9))
    ;; Send client to workspace
    (,(make-shift-key "1") . ,(make-callback wm-set-focused-client-workspace 1))
    (,(make-shift-key "2") . ,(make-callback wm-set-focused-client-workspace 2))
    (,(make-shift-key "3") . ,(make-callback wm-set-focused-client-workspace 3))
    (,(make-shift-key "4") . ,(make-callback wm-set-focused-client-workspace 4))
    (,(make-shift-key "5") . ,(make-callback wm-set-focused-client-workspace 5))
    (,(make-shift-key "6") . ,(make-callback wm-set-focused-client-workspace 6))
    (,(make-shift-key "7") . ,(make-callback wm-set-focused-client-workspace 7))
    (,(make-shift-key "8") . ,(make-callback wm-set-focused-client-workspace 8))
    (,(make-shift-key "9") . ,(make-callback wm-set-focused-client-workspace 9))
    ;; Send client to monitor
    (,(make-shift-key "i") . ,wm-client-monitor-prev)
    (,(make-shift-key "o") . ,wm-client-monitor-next)))

(when (wm-init)
  (wm-reconfigure config)
  (wm-grab-keys wm-keybindings)
  (wm-set-key-press-handler!
   (lambda (mod keysym)
     (display (list mod keysym))
     (newline)))
  (wm-run))