(in-package :stumpwm) (ignore-errors (load "~/.stumpwm.d/setup")) ;;; Variables (defvar *slynk-port* 4006 "Default port to run the slynk server on.") (defvar *current-theme* 'light "Current loaded theme, possible values are `light' and `dark'.") (defvar *groups* (list "emacs" "browser" "other" "media") "Default groups.") (defparameter +bookmark-file+ "~/.local/share/bookmarks") (ignore-errors (load "~/.stumpwm.d/commands")) (setf *mouse-focus-policy* :click *top-level-error-action* :message *input-window-gravity* :center *message-window-gravity* :center) ;;; Init (when *initializing* (xft:cache-fonts) (dolist (group *groups*) (gnew group)) (gnext) (gkill) (gnext) (uiop:run-program "~/.stumpwm.d/xsession") (setf *mode-line-background-color* "white" *mode-line-foreground-color* "black" *screen-mode-line-format* (list "[^B%n^b] %W |" '(:eval (run-shell-command "date +'%d/%m/%Y %H:%M'" t))) stumptray:*tray-viwin-background* "#ffffff") (mode-line) (stumptray:stumptray)) ;;; Frame preferences (define-frame-preference "emacs" (0 t t :create t :class "Emacs")) (define-frame-preference "browser" (0 t t :create t :class "firefox") (0 t t :create t :class "Chromium") (0 t t :create t :class "Nyxt") (0 t t :create t :class "Brave")) (define-frame-preference "media" (0 t t :create t :class "mpv") (0 t t :create t :class "cantata") (0 t t :create t :class "Ario")) ;;; Remapped keys (define-remapped-keys '(("okular" ("C-n" . "Down") ("C-p" . "Up") ("C-f" . "Right") ("C-b" . "Left") ("C-v" . "Next") ("M-v" . "Prior") ("M-w" . "C-c") ("C-w" . "C-x") ("C-y" . "C-v") ("M-<" . "Home") ("M->" . "End")) ("Brave-browser" ("C-n" . "Down") ("C-p" . "Up") ("C-b" . "Left") ("C-f" . "Right") ("C-v" . "Next") ("M-v" . "Prior") ("M-w" . "C-c") ("C-y" . "C-v") ("M-<" . "Home") ("M->" . "End") ("C-M-b" . "M-Left") ("C-M-f" . "M-f") ("C-s" . "C-f") ("C-k" . ("C-S-End" "C-x"))))) ;;; Keybindings (set-prefix-key (kbd "M-z")) (defmacro define-keys (map bindings) "Define multiple keybindings in @var{map}, according to @var{bindings}. Bindings should be a list of cons pairs of keycodes, suitable for applying `kbd' on them, and commands. For example: @code{ (define-keys *top-map* ((\"s-j\" . \"fnext\") (\"s-k\" . \"fprev\") (\"s-q\" . \"delete\") (\"s-w\" . \"run-shell-command firefox\"))) }" `(progn ,@(loop :for binding :in bindings :collect (destructuring-bind (key . command) binding `(define-key ,map (kbd ,key) ,command))))) (define-keys *top-map* (("s-a" . "gselect emacs") ("s-b" . "mode-line") ("s-e" . "gselect other") ("s-j" . "fnext") ("s-k" . "fprev") ("s-m" . "run-shell-command icedove") ("s-n" . "pull-hidden-next") ("s-o" . "gselect browser") ("s-p" . "pull-hidden-previous") ("s-q" . "delete") ("s-r" . "launcher-command") ("s-u" . "gselect media") ("s-w" . "run-shell-command chromium") ("s-A" . "gmove emacs") ("s-O" . "gmove browser") ("s-E" . "gmove other") ("s-R" . "launcher-command") ("s-U" . "gmove media") ("s-RET" . "run-shell-command st -e tmux a") ("s-BackSpace" . "powermenu") ("XF86AudioRaiseVolume" . "volume-up") ("XF86AudioLowerVolume" . "volume-down") ("XF86AudioMute" . "volume-toggle-mute"))) (define-keys *root-map* (("0" . "remove") ("1" . "only") ("3" . "hsplit") ("2" . "vsplit") ("b" . "pull-from-windowlist") ("e" . "run-shell-command emacsclient -c") ("M-b" . "bookmarks") ("M-c" . "powermenu") ("M-e" . "run-shell-command emacsclient -c") ("M-h" . "move-window left") ("M-j" . "move-window down") ("M-k" . "move-window up") ("M-l" . "move-window right") ("M-p" . "pass-copy-menu") ("M-t" . "run-shell-command otpmenu") ("M-r" . "launcher-command")))