Skip to content

Instantly share code, notes, and snippets.

@tychoish
Created September 3, 2020 19:43
Show Gist options
  • Save tychoish/c30e3a6d44855143914fd820cd03bae6 to your computer and use it in GitHub Desktop.
Save tychoish/c30e3a6d44855143914fd820cd03bae6 to your computer and use it in GitHub Desktop.
(set-prefix-key (kbd "C-q"))
;; Insertions into top level binding.
(define-key *top-map* (kbd "XF86AudioLowerVolume") "volume-quiet")
(define-key *top-map* (kbd "XF86AudioRaiseVolume") "volume-loud")
(define-key *top-map* (kbd "XF86AudioMute") "volume-toggle")
(define-key *top-map* (kbd "F2") "lock")
;;
;; Insertions into root level bindings.
;;
(define-key *root-map* (kbd "d") "dmenu")
(define-key *root-map* (kbd "C-d") "dmenu-tychoish")
(define-key *root-map* (kbd "b") "toggle-mouse")
(define-key *root-map* (kbd "c") "term")
(define-key *root-map* (kbd "C-c") "sterm")
(define-key *root-map* (kbd "l") "mode-line")
(define-key *root-map* (kbd "C-.") "gnext")
(define-key *root-map* (kbd "C-m") "gprev")
(define-key *root-map* (kbd "p") "pull-hidden-next")
(define-key *root-map* (kbd "C-q") "pull-hidden-other")
(define-key *root-map* (kbd "q") "send-escape")
(define-key *root-map* (kbd "i") "foucault-screen")
(define-key *root-map* (kbd "TAB") "fselect")
(define-key *root-map* (kbd "C-TAB") "fother")
(define-key *root-map* (kbd "F6") "brightness-inc")
(define-key *root-map* (kbd "F5") "brightness-dec")
;;
;; General group manipulation bindings.
;;
(define-key *groups-map* (kbd "F") "move-group-forward")
(define-key *groups-map* (kbd "B") "move-group-backward")
(define-key *groups-map* (kbd "a") "gselect 1")
(define-key *groups-map* (kbd "s") "gselect 2")
(define-key *groups-map* (kbd "d") "gselect 3")
(define-key *groups-map* (kbd "f") "gselect 4")
(define-key *groups-map* (kbd "q") "gselect 5")
(define-key *groups-map* (kbd "w") "gselect 6")
(define-key *groups-map* (kbd "e") "gselect 7")
(define-key *groups-map* (kbd "r") "gselect 9")
(define-key *groups-map* (kbd "t") "gselect 10")
;;
;; Setup submaps
;;
(defvar *tycho-map*)
(defvar *system-map*)
(defvar *dump-layout-map*)
(defvar *window-map*)
(defvar *volume-map*)
(defvar *auth-map*)
(define-key *root-map* (kbd "C-a") '*auth-map*)
(define-key *root-map* (kbd "a") '*auth-map*)
(define-key *root-map* (kbd "C-s") '*system-map*)
(define-key *root-map* (kbd "C-t") '*tycho-map*)
(define-key *root-map* (kbd "t") '*tycho-map*)
(define-key *root-map* (kbd "C-x") '*window-map*)
(define-key *root-map* (kbd "x") '*window-map*)
(define-key *root-map* (kbd "v") '*volume-map*)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; tycho "catchall" keybinding for personal functionality, like C-c in emacs
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(setf *tycho-map*
(let ((m (make-sparse-keymap)))
(define-key m (kbd "b") "bakhtin-screen")
(define-key m (kbd "i") "foucault-term")
(define-key m (kbd "f") "foucault-screen")
(define-key m (kbd "O") "derrida-term")
(define-key m (kbd "o") "derrida-screen")
(define-key m (kbd "B") "bakhtin-term")
(define-key m (kbd "b") "bakhtin-screen")
(define-key m (kbd "w") "emacs")
(define-key m (kbd "w") "emacs-work")
(define-key m (kbd "h") "emacs-hud")
(define-key m (kbd "e") "emacs-tycho")
(define-key m (kbd "d") "dmenu-tychoish")
(define-key m (kbd "c") "capture-menu")
(define-key m (kbd "t") "capture-task")
(define-key m (kbd "n") "capture-note")
(define-key m (kbd "p") "capture-paste")
(define-key m (kbd "m") 'mpd:*mpd-map*)
m))
(setf *system-map*
(let ((m (make-sparse-keymap)))
(define-key m (kbd "C-s") "swank")
(define-key m (kbd "C-l") "engage-laptop")
(define-key m (kbd "C-d") "engage-dual")
(define-key m (kbd "b") "banish")
(define-key m (kbd "C-b") "toggle-mouse")
m))
(setf *dump-layout-map*
(let ((m (make-sparse-keymap)))
(define-key m (kbd "d") "dump-desktop-dual")
(define-key m (kbd "h") "dump-desktop-home")
(define-key m (kbd "l") "dump-desktop-laptop")
(define-key m (kbd "o") "dump-desktop-office")
(define-key m (kbd "D") "dump-desktop-dual-alt")
(define-key m (kbd "H") "dump-desktop-home-alt")
(define-key m (kbd "L") "dump-desktop-laptop-alt")
(define-key m (kbd "O") "dump-desktop-office-alt")
m))
(setf *window-map*
(let ((m (make-sparse-keymap)))
(define-key m (kbd "0") "remove")
(define-key m (kbd "1") "only")
(define-key m (kbd "2") "vsplit")
(define-key m (kbd "3") "hsplit")
(define-key m (kbd "5") "fclear")
(define-key m (kbd "6") "resize")
(define-key m (kbd "t") "toggle-screen")
(define-key m (kbd "c") "repack-window-numbers")
(define-key m (kbd "i") "info")
(define-key m (kbd "h") "restore-desktop-home")
(define-key m (kbd "l") "restore-desktop-laptop")
(define-key m (kbd "d") "restore-desktop-dual")
(define-key m (kbd "o") "restore-desktop-office")
(define-key m (kbd "H") "restore-desktop-home-alt")
(define-key m (kbd "L") "restore-desktop-laptop-alt")
(define-key m (kbd "D") "restore-desktop-home-alt")
(define-key m (kbd "O") "restore-desktop-office-alt")
(define-key m (kbd "p") "place-existing-windows")
(define-key m (kbd "s") "swap-window")
(define-key m (kbd "d") '*dump-layout-map*)
(define-key m (kbd "C-d") '*dump-layout-map*)
m))
(setf *volume-map*
(let ((m (make-sparse-keymap)))
(define-key m (kbd "l") "volume-loud")
(define-key m (kbd "q") "volume-quiet")
(define-key m (kbd "m") "volume-toggle")
m))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment