From 48699f634d08fb9f1dd7c91431d7feda10c283e0 Mon Sep 17 00:00:00 2001 From: Lord_Devi Date: Mon, 22 Jul 2024 22:22:21 -0400 Subject: [PATCH] Working on xorg. --- .config/stumpwm/lisp/functions.lisp | 20 ++++++++++++++++++++ .config/stumpwm/lisp/keymap.lisp | 15 +++++++++------ 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/.config/stumpwm/lisp/functions.lisp b/.config/stumpwm/lisp/functions.lisp index 776ba46..994c619 100644 --- a/.config/stumpwm/lisp/functions.lisp +++ b/.config/stumpwm/lisp/functions.lisp @@ -37,3 +37,23 @@ run-or-raise with group search t." (defcommand emacsclient-launch () () (run-shell-command "emacsclient -c")) + +;; Bind to top and root map at the same time. +(defun mgk-define-key (key command) + (define-key *top-map* (kbd (concat "s-" key )) command) + (define-key *root-map* (kbd key) command)) + +;;; Splits +(defcommand hsplit-and-focus () () + "create a new frame on the right and focus it." + (with-focus-lost + (hsplit) + (move-focus :right))) + +(defcommand vsplit-and-focus () () + "create a new frame below and focus it." + (with-focus-lost + (vsplit) + (move-focus :down))) +(define-key *root-map* (kbd "v") "hsplit-and-focus") +(define-key *root-map* (kbd "s") "vsplit-and-focus") diff --git a/.config/stumpwm/lisp/keymap.lisp b/.config/stumpwm/lisp/keymap.lisp index 5026ab6..de8c672 100644 --- a/.config/stumpwm/lisp/keymap.lisp +++ b/.config/stumpwm/lisp/keymap.lisp @@ -21,9 +21,11 @@ ;;(define-key *root-map* (kbd "s") "colon1 exec kitty -e ssh ") ;; Launch emacsclient if not already loaded. Otherwise, jump it and ;; raise it. -(define-key *root-map* (kbd "e") "decide-on-emacsclient") +;;(define-key *root-map* (kbd "e") "decide-on-emacsclient") +(mgk-define-key "e" "decide-on-emacsclient") +(mgk-define-key "E" "emacsclient-launch") ;; Create a brand new emacsclient session if one is already running. -(define-key *root-map* (kbd "E") "emacsclient-launch") +;;(define-key *root-map* (kbd "E") "emacsclient-launch") ;; }}} ;; {{{ ;; Navigate focus by direction. @@ -82,10 +84,11 @@ ;;(define-key *root-map* (kbd "M-j") "move-window down") ;; }}} ;; {{{ -;; Vertical Split. -(define-key *root-map* (kbd "s") "vsplit") -;; Horizontal Split. -(define-key *root-map* (kbd "S") "hsplit") +;; Splits +(mgk-define-key "s" "hsplit-and-focus") +(mgk-define-key "v" "vsplit-and-focus") +;;(define-key *root-map* (kbd "s") "vsplit") +;;(define-key *root-map* (kbd "S") "hsplit") ;; Remove currently active frame from split. (define-key *root-map* (kbd "R") "remove-split") ;; Resize frames.