awesome/conf/client/keys.fnl

46 lines
1.0 KiB
Fennel

;;; conf/client/keys.fnl --- Client keys
;;; Code:
(var keys {})
(local awful (require :awful))
(local beautiful (require :beautiful))
(local gears (require :gears))
(local key (. (require :lib.keys) :key))
;;;
;; Functions
(fn register [field ...]
(tset keys field (gears.table.join ...)))
(fn cinv [k]
(fn [c]
(let [v (. c k)]
(tset c k (not v)))))
;;;
;; Configuration
(register :client
(key [:mod] :q (lambda [c] (: c :kill)))
(key [:mod] :w (lambda [c] (set c.minimized true)))
(key [:mod] :t (lambda [c] (awful.titlebar.toggle c beautiful.titlebar_position)))
(key [:mod :shift] :t (lambda [c] (awful.titlebar.toggle c :left)))
(key [:mod :ctrl] :t (lambda [c] (awful.titlebar.toggle c)))
(key [:mod] :a (cinv :floating))
(key [:mod] :f (cinv :fullscreen))
(key [:mod] :m (cinv :maximized)) ;; FIXME behaves weird
(key [:mod] :s (cinv :sticky)))
(register :floating
(. keys :client)
(key [:alt :shift] :h (lambda [c] (: c :relative_move {:x -100}))))
keys
;;; conf/client/keys.fnl ends here