diff --git a/.emacs.d/init.el b/.emacs.d/init.el index 693bf9f..daaf007 100644 --- a/.emacs.d/init.el +++ b/.emacs.d/init.el @@ -532,23 +532,26 @@ (defun x-focus-frame (FRAME &optional NOACTIVATE)) (frames-only-mode t) (menu-bar-mode 0) - (if (executable-find "i3") - (progn - (defun split-window-below-i3 () - "It's like `split-window-below', but uses i3 stuff" - (interactive) - (call-process "i3" nil nil nil "split v") - (make-frame)) - (defun split-window-right-i3 () - "It's like `split-window-right', but uses i3 stuff" - (interactive) - (call-process "i3" nil nil nil "split h") - (make-frame)) - (bind-key "C-x 2" 'split-window-below-i3) - (bind-key "C-x 3" 'split-window-right-i3)) - (progn - (bind-key "C-x 2" 'make-frame-command) - (bind-key "C-x 3" 'make-frame-command)))) + + (defun split-window-below-i3 () + "It's like `split-window-below', but uses i3 stuff when available" + (interactive) + (cond ((not (display-graphic-p)) (split-window-below)) + ((executable-find "i3") + (call-process "i3" nil nil nil "split v") + (make-frame)) + (t (make-frame)))) + + (defun split-window-right-i3 () + "It's like `split-window-right', but uses i3 stuff when available" + (interactive) + (cond ((not (display-graphic-p)) (split-window-right)) + ((executable-find "i3") + (call-process "i3" nil nil nil "split h") + (make-frame)) + (t (make-frame)))) + (bind-key "C-x 2" 'split-window-below-i3) + (bind-key "C-x 3" 'split-window-right-i3)) (use-package crux :ensure :bind (("C-a" . crux-move-beginning-of-line)))