Rolled new Emacs configuration, added Stump config

This commit is contained in:
opal
2021-12-17 20:26:48 -08:00
parent 65a727df70
commit bca10bd035
3 changed files with 717 additions and 65 deletions

175
StumpWM.org Normal file
View File

@@ -0,0 +1,175 @@
#+TITLE: StumpWM Configuration
#+PROPERTY: header-args:emacs-lisp :tangle ~/Dotfiles/config/stumpwm/init.el :mkdirp yes
In my quest to make my computer a Lisp machine in its own right, I am using StumpWM as my window manager.
* Init
#+begin_src lisp
(in-package :stumpwm)
;; (defvar *sbcl-path* "~/.guix-home/profile/share/common-lisp/sbcl/")
;; StumpWM Modules
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-swm-gaps")
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-ttf-fonts")
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-stumptray")
(stumpwm:add-to-load-path "~/.guix-home/profile/share/common-lisp/sbcl/stumpwm-kbd-layouts")
#+end_src
* Environment
** Workspaces
#+begin_src lisp
(run-commands
"gnewbg I"
"gnew II"
"gnewbg III"
"gnewbg IV"
"gnewbg V"
"gnewbg-float F")
#+end_src
** Set Prefix
#+begin_src lisp
(set-prefix-key (kbd "s-d"))
#+end_src
** Focus window with mouth
#+begin_src lisp
setf *mouse-focus-policy* :click)
#+end_src
** Messages
#+begin_src lisp
(setq *message-window-gravity* :top)
(setq *message-window-padding* 10)
(setq *message-window-y-padding 10)
#+end_src
** Command Window
#+begin_src lisp
(setq *input-window-gravity* :center)
#+end_src
* Keyboard
** Load Keyboard Layout Module
#+begin_src lisp
;; (load-module "kbd-layouts")
#+end_src
** Remap Caps Lock
#+begin_src lisp
setf kbd-layouts:*caps-lock-behavior* :esc)
#+end_src
** Xmodmap
#+begin_src lisp
;; (run-shell-command "xmodmap ~/Dotfiles/.config/Xmodmap")
#+end_src
** Keybinds
#+begin_src lisp
;; Set some super key bindings
(define-key *top-map* (kbd "s-h") "move-focus left")
(define-key *top-map* (kbd "s-l") "move-focus right")
(define-key *top-map* (kbd "s-j") "move-focus down")
(define-key *top-map* (kbd "s-k") "move-focus up")
(define-key *top-map* (kbd "s-S-h") "move-window left")
(define-key *top-map* (kbd "s-S-l") "move-window right")
(define-key *top-map* (kbd "s-S-j") "move-window down")
(define-key *top-map* (kbd "s-S-k") "move-window up")
(define-key *top-map* (kbd "s-f") "fullscreen")
(define-key *top-map* (kbd "s-r") "iresize")
(define-key *top-map* (kbd "s-S-q") "delete")
(define-key *top-map* (kbd "s-SPC") "run-shell-command emacsclient -e \"(call-interactively #'app-launcher-run-app)\"")
;; (define-key *top-map* (kbd "C-s-l") "run-shell-command slock")
(define-key *top-map* (kbd "s-TAB") "next-in-frame")
(define-key *top-map* (kbd "s-S-TAB") "prev-in-frame")
(define-key *top-map* (kbd "s-1") "gselect I")
(define-key *top-map* (kbd "s-2") "gselect II")
(define-key *top-map* (kbd "s-3") "gselect III")
(define-key *top-map* (kbd "s-4") "gselect IV")
(define-key *top-map* (kbd "s-5") "gselect V")
(define-key *top-map* (kbd "s-S-1") "gmove I")
(define-key *top-map* (kbd "s-S-2") "gmove II")
(define-key *top-map* (kbd "s-S-3") "gmove III")
(define-key *top-map* (kbd "s-S-4") "gmove IV")
(define-key *top-map* (kbd "s-S-5") "gmove V")
;; Brightness and volume
;; (define-key *top-map* (kbd "XF86MonBrightnessDown") "run-shell-command brightnessctl set 5%-")
;; (define-key *top-map* (kbd "XF86MonBrightnessUp") "run-shell-command brightnessctl set +5%")
;; (define-key *top-map* (kbd "XF86AudioLowerVolume") "run-shell-command amixer set Master 3%- unmute")
;; (define-key *top-map* (kbd "XF86AudioRaiseVolume") "run-shell-command amixer set Master 3%+ unmute")
;; (define-key *top-map* (kbd "XF86AudioMute") "run-shell-command amixer set Master toggle")
#+end_src
* UI
** Colors
#+begin_src lisp
;; Set UI colors
(set-border-color "#c792ea")
(set-bg-color "#232635")
(set-fg-color "#A6Accd")
(set-msg-border-width 2)
#+end_src
** Gaps
#+begin_src lisp
(load-module "swm-gaps")
(setf swm-gaps:*inner-gaps-size* 3)
(run-commands "toggle-gaps-on")
#+end_src
** Fonts
#+begin_src lisp
;; Enable TTF fonts
;; (load-module "ttf-fonts")
;; (setf xft:*font-dirs* '("/home/opal/.guix-home/profile/share/fonts/"))
;; (setf clx-truetype:+font-cache-filename+ "/home/daviwil/.local/share/fonts/font-cache.sexp")
;; (xft:cache-fonts)
;; (set-font (make-instance 'xft:font :family "Fira Mono" :subfamily "Regular" :size 16))
#+end_src
** Mode-Line
#+begin_src lisp
;; Set mode line colors
(setf *mode-line-background-color* "#232635")
(setf *mode-line-foreground-color* "#A6Accd")
;; Set the mode line format
(setf *screen-mode-line-format* "[^B%n^b] %W ^>%d")
(run-commands "mode-line" "mode-line")
;; Start the mode line
(run-commands "mode-line")
#+end_src
** System tray
#+begin_src lisp
;; Add the system tray module
(load-module "stumptray")
(stumptray:stumptray)
#+end_src
* Applications
#+begin_src lisp
;; (run-shell-command "feh --bg-scale ~/.dotfiles/backgrounds/samuel-ferrara-uOi3lg8fGl4-unsplash.jpg")
;; (run-shell-command "dunst")
;; (run-shell-command "nm-applet")
;; (run-shell-command "syncthing-gtk --minimized")
;; (run-shell-command "redshift -l 37.983810:23.727539 -t 6500:3500")
(run-shell-command "emacs")
#+end_src
* Repl Start
#+begin_src lisp
(require :slynk)
(slynk:create-server :dont-close t)
#+end_src
* Reference
- https://github.com/daviwil/dotfiles/blob/guix-home/Stump.org
- https://github.com/alezost/stumpwm-config
- https://github.com/herbertjones/my-stumpwm-config
- https://github.com/Phundrak/dotfiles/blob/master/org/config/stumpwm.org