-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add keybindings to split the current frame
+ Add a binding to open kcalc so we can better observe how the frame splitting behavior is working. + Move the keybinding definitions into their own file so they are easier to find.
- Loading branch information
Showing
3 changed files
with
35 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(in-package #:mahogany) | ||
|
||
(defun handle-server-stop (sequence seat) | ||
(declare (ignore sequence seat)) | ||
(server-stop *compositor-state*)) | ||
|
||
(defun open-terminal (sequence seat) | ||
(declare (ignore sequence seat)) | ||
(sys:open-terminal)) | ||
|
||
(defun open-kcalc (sequence seat) | ||
(declare (ignore sequence seat)) | ||
(uiop:launch-program (sys:find-program "kcalc"))) | ||
|
||
(defun split-frame-h (sequence seat) | ||
(declare (ignore sequence seat)) | ||
(let ((frame (mahogany-current-frame *compositor-state*))) | ||
(when frame | ||
(tree:split-frame-h frame :direction :left)))) | ||
|
||
(defun split-frame-v (sequence seat) | ||
(declare (ignore sequence seat)) | ||
(let ((frame (mahogany-current-frame *compositor-state*))) | ||
(when frame | ||
(tree:split-frame-v frame :direction :top)))) | ||
|
||
(setf (mahogany-state-keybindings *compositor-state*) | ||
(list (define-kmap | ||
(kbd "C-t") (define-kmap | ||
(kbd "q") #'handle-server-stop | ||
(kbd "c") #'open-terminal | ||
(kbd "s") #'split-frame-v | ||
(kbd "S") #'split-frame-h | ||
(kbd "+") #'open-kcalc)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters