~ilmu/vegur

dcd1300fe9c4226a6e610e588db77ed1b088807c — ilmu 1 year, 10 months ago 65cbc45
made this more sensible
D bootstrap-figs/README => bootstrap-figs/README +0 -1
@@ 1,1 0,0 @@
Rename these files when you place them in `~/.config/$FILE_NAME/init.$FILE_EXT` - that should make sense.

A bootstrap-figs/emacs/auto-save-list/.saves-13220-vegur~ => bootstrap-figs/emacs/auto-save-list/.saves-13220-vegur~ +4 -0
@@ 0,0 1,4 @@
/home/ilmu/datalisp/cxp/cxp.lisp
/home/ilmu/datalisp/cxp/#cxp.lisp#
/home/ilmu/datalisp/cxp/SPECIFICATION
/home/ilmu/datalisp/cxp/#SPECIFICATION#

A bootstrap-figs/emacs/auto-save-list/.saves-1394-vegur~ => bootstrap-figs/emacs/auto-save-list/.saves-1394-vegur~ +6 -0
@@ 0,0 1,6 @@
/home/ilmu/.config/stumpwm/lib.lisp
/home/ilmu/.config/stumpwm/#lib.lisp#
/home/ilmu/.config/stumpwm/init.lisp
/home/ilmu/.config/stumpwm/#init.lisp#
/home/ilmu/.config/stumpwm/keymap.lisp
/home/ilmu/.config/stumpwm/#keymap.lisp#

R bootstrap-figs/emacs.el => bootstrap-figs/emacs/init.el +2 -0
@@ 41,6 41,8 @@
(evil-define-key 'visual sly-mode-map (kbd "<leader>e") 'sly-eval-region)
(evil-define-key 'normal sly-mode-map (kbd "<leader>e") 'sly-eval-last-expression)
(evil-define-key 'normal sly-mode-map (kbd "<leader>h") 'sly-documentation)
;; Fix annoying thing in sly repl.
(evil-define-key 'insert sly-mode-map (kbd ",") 'self-insert-command)

;; emacs-youtube-dl


A bootstrap-figs/emacs/transient/history.el => bootstrap-figs/emacs/transient/history.el +1 -0
@@ 0,0 1,1 @@
nil
\ No newline at end of file

D bootstrap-figs/stumpwm.lisp => bootstrap-figs/stumpwm.lisp +0 -35
@@ 1,35 0,0 @@
(require :ttf-fonts)
(setf xft:*font-dirs* '("/run/current-system/profile/share/fonts/"))
(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
(xft:cache-fonts)
(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11))
(setf *data-dir* (concat (getenv "HOME") "/.cache/stumpwm"))

(in-package :stumpwm)
(define-key *root-map* (kbd "u") "exec chromium")
(define-key *root-map* (kbd "z") "exec kitty")
(define-key *top-map* (kbd "M-z") "exec kitty")
(define-key *top-map* (kbd "M-x") "exec")
(define-key *top-map* (kbd "M-c") "colon")
(define-key *top-map* (kbd "M-h") "fprev")
(define-key *top-map* (kbd "M-l") "fnext")
(define-key *top-map* (kbd "M-j") "next-in-frame")
(define-key *top-map* (kbd "M-k") "prev-in-frame")

;; meta-shift-hjkl to move window across splits (and create them or close them as needed).
;; the moving across splits thing should be a mode, hold shift to move focus and otherwise you move window w/hjkl.
;; some keybinds to move stacks of windows to (and from) different groups, also useful; merging and splitting groups.

#| replify stump
(in-package :stumpwm)

(require :swank)
(swank-loader:init)
(swank:create-server :port 4004
                     :style swank:*communication-style*
                     :dont-close t)
|#

#| bind keys to *root-map* for C-t prefixed commands and *top-map* for unprefixed commands.
(stumpwm:define-key stumpwm:*root-map* (stumpwm:kbd "u") "exec kitty")
|#

A bootstrap-figs/stumpwm/init.lisp => bootstrap-figs/stumpwm/init.lisp +25 -0
@@ 0,0 1,25 @@
(in-package :stumpwm)

(require :ttf-fonts)
(setf xft:*font-dirs* '("/run/current-system/profile/share/fonts/"))
(setf clx-truetype:+font-cache-filename+ (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
(xft:cache-fonts)
(set-font (make-instance 'xft:font :family "DejaVu Sans Mono" :subfamily "Book" :size 11))

(defun append-to-path (path str)
  (pathname (concatenate 'string (namestring path) str)))

(setf *data-dir* (append-to-path (uiop:xdg-cache-home) "stumpwm/"))
(setf *cfg-dir* (append-to-path (uiop:xdg-config-home) "stumpwm/"))

(defun load-config-file (file)
  (load (append-to-path *cfg-dir* file)))

(load-config-file "keyboard.lisp") ;; caps -> hyper, sort out modifiers.
(load-config-file "lib.lisp")      ;; define various commands that can be bound.
(load-config-file "swank.lisp")    ;; make it possible to open repl to running stump instance.
(load-config-file "keymap.lisp")     ;; bind commands to keys in keymaps.

#| bind keys to *root-map* for C-t prefixed commands and *top-map* for unprefixed commands.
(stumpwm:define-key stumpwm:*root-map* (stumpwm:kbd "u") "exec kitty")
|#

A bootstrap-figs/stumpwm/keymap.lisp => bootstrap-figs/stumpwm/keymap.lisp +22 -0
@@ 0,0 1,22 @@
#| Keymap

*top-map*
 ^    |     use prefix or mode switch
 |    v     to move *top-map* pointer down
*root-map*
   ...
*other-maps*

The idea is to maintain DSLs for interacting.

|#

(define-key *root-map* (kbd "u") "exec chromium")
(define-key *root-map* (kbd "z") "exec kitty")
(define-key *top-map* (kbd "M-z") "exec kitty")
(define-key *top-map* (kbd "M-x") "exec")
(define-key *top-map* (kbd "M-c") "colon")
(define-key *top-map* (kbd "M-h") "fprev")
(define-key *top-map* (kbd "M-l") "fnext")
(define-key *top-map* (kbd "M-j") "next-in-frame")
(define-key *top-map* (kbd "M-k") "prev-in-frame")

A bootstrap-figs/stumpwm/lib.lisp => bootstrap-figs/stumpwm/lib.lisp +51 -0
@@ 0,0 1,51 @@
#| Modes

Insert mode    :~: default *top-map*
Rearrange mode :~: 

Okay looks like stump already has the concept of modes.

The *root-map* can be accessed via prefix or by pushing it into *top-map* with `command-mode` command.
Mode is exited with C-g which I suppose is bound to `TODO` command in the *top-map* during `command-mode`.

This file should be a collection of commands that I bind

|#
                     ;; args 
(defcommand dump-top-map () () ;; interactive args
  (with-open-file (s (append-to-path *data-dir* "top-map.sexp") :direction :output)))


(defvar *input-mode* 'insert-mode)
(defvar *rearrange-map* )



#| QUESTLOG

Commands I want:
----------------
Open emacs with stumpwm config file $FILE
Open emacs with sly repl into stumpwm
Chaining commands sequentially
Query layout left/right/top/down
Switch modes (rebind *top-map*)
Intercept unmodified keys by rebinding in *top-map*
Split frame, close split
Move window between frames and create / close splits as necessary
Move windows in frame to other group
Summon windows from frame in other group as new split (so the stack abstraction)
Name windows / name frames / name groups
Serialize and load / unload for various state
API for datalisp (maybe via swank thread)










|#

A bootstrap-figs/stumpwm/swank.lisp => bootstrap-figs/stumpwm/swank.lisp +14 -0
@@ 0,0 1,14 @@
;; credit https://github.com/kitnil/dotfiles/blob/c247e7a3cab9b7159fad1f37fab6c0e36d0ba21b/dot_stumpwm.d/swank.lisp

(require :swank)

(swank-loader:init)

(defcommand swank (port) ((:string "Port number: "))
  (sb-thread:make-thread
   (lambda ()
     (let ((swank::*loopback-interface* "127.0.0.1"))
       (swank:create-server :port (parse-integer port)
			 ;; :style swank:*communication-style*
                            :dont-close t)))
   :name "swank"))

M config.scm => config.scm +1 -2
@@ 31,8 31,7 @@
            "emacs-evil-collection" "zathura" "zathura-pdf-mupdf"
	    "ungoogled-chromium" "setxkbmap" "font-dejavu" "tree"
            "qutebrowser" "sbcl" "stumpwm" "sbcl-stumpwm-ttf-fonts"
	    ;; From generated config
            "dmenu" "xterm" "nss-certs"))
            "sbcl-slynk" "cl-slime-swank" "xterm" "nss-certs"))

      (list `(,stumpwm "lib"))
      %base-packages))