changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > infra > home / .stumpwm.d/init.lisp

changeset 95: f69061a590da
parent: 978ce75e54af
author: Richard Westhaver <ellis@rwest.io>
date: Sat, 07 Sep 2024 22:40:44 -0400
permissions: -rw-r--r--
description: moonlander concessions
1 (require :stumpwm)
2 
3 (in-package :stumpwm)
4 
5 (stumpwm:set-prefix-key (kbd "s-SPC"))
6 
7 (ignore-errors
8  (ql:quickload '(:std :core :prelude :user :swank)))
9 
10 (defcommand quickload (system)
11  ((:rest "System: "))
12  "Load a system with QL:QUICKLOAD"
13  (ql:quickload system))
14 
15 (defcommand load-std () ()
16  (ql:quickload :std))
17 
18 (defcommand load-prelude () ()
19  (ql:quickload :prelude))
20 
21 (defcommand load-core () ()
22  (ql:quickload :core))
23 
24 (defcommand load-user () ()
25  (ql:quickload :user)
26  (in-package :user))
27 
28 (setq *mouse-focus-policy* :sloppy
29  *float-window-modifier* :SUPER
30  *startup-message* "Greetings, stranger.")
31 
32 (set-module-dir "~/.stumpwm.d/contrib")
33 (init-load-path *module-dir*)
34 
35 (ql:quickload :clx-truetype)
36 (load-module "ttf-fonts")
37 (xft:cache-fonts)
38 (set-font (make-instance 'xft:font
39  :family "Mononoki Nerd Font"
40  :subfamily "Regular"
41  :size 12))
42 
43 (load-module "swm-golden-ratio")
44 (unless swm-golden-ratio:*golden-ratio-on*
45  (swm-golden-ratio:toggle-golden-ratio))
46 
47 (load-module "screenshot")
48 (load-module "cpu")
49 (load-module "hostname")
50 (load-module "mpd")
51 (load-module "mem")
52 (ql:quickload '(:cl-diskspace :cl-mount-info))
53 (load-module "disk")
54 (setq *mode-line-highlight-template* "«~A»")
55 (setf *screen-mode-line-format* (list "[^B%n^b] %W^> %C | %M | %l | %D | %h | %d"))
56 
57 (ql:quickload :xml-emitter)
58 (ql:quickload :dbus)
59 
60 (set-fg-color "#ffffff")
61 (set-bg-color "#000000")
62 (set-border-color "#7E5D90")
63 (set-focus-color "#170F14")
64 (set-unfocus-color "#232731")
65 (set-win-bg-color "#22272F")
66 (set-float-focus-color "#8ED3A1")
67 (set-float-unfocus-color "#232731")
68 
69 (setf *mode-line-background-color* "#161613")
70 (setf *mode-line-foreground-color* "#FFFFFF")
71 (setf *mode-line-border-color* "#28394c")
72 (setf *mode-line-position* :bottom)
73 
74 (setf *colors* (list "#010101" ; 0 black
75  "#BF616A" ; 1 red
76  "#A3BE8C" ; 2 green
77  "#EBCB8B" ; 3 yellow
78  "#5E81AC" ; 4 blue
79  "#9D5AAF" ; 5 magenta
80  "#8FBCBB" ; 6 cyan
81  "#FEFEFE")) ; 7 white
82 
83 (setf *window-format* "%m%n%s%c")
84 (set-normal-gravity :center)
85 (set-maxsize-gravity :center)
86 (set-transient-gravity :center)
87 (setf *time-modeline-string* "%F %H:%M")
88 (setf *group-format* "%t")
89 (setq *mode-line-timeout* 4)
90 
91 (which-key-mode)
92 
93 (when *initializing*
94  (grename "*MAIN*")
95  (gnewbg "*ORG*")
96  (gnewbg "*MEDIA*")
97  (gnewbg "*SCRATCH*")
98  (run-shell-command "sh ~/.fehbg")
99  (when (equal (machine-instance) "zor")
100  (run-shell-command "sh ~/.screenlayout/default.sh"))
101  (dolist (h (screen-heads (current-screen)))
102  (enable-mode-line (current-screen) h t)))
103 
104 (clear-window-placement-rules)
105 
106 (define-frame-preference "*MAIN*" (nil t t :class "Tiling"))
107 (define-frame-preference "*ORG*" (nil t t :class "Tiling"))
108 (define-frame-preference "*MEDIA*" (nil t t :class "Floating"))
109 (define-frame-preference "*SCRATCH*" (nil t t :class "Tiling"))
110 
111 (setf *dynamic-group-master-split-ratio* 1/2)
112 
113 (defcommand term (&optional program) ()
114  (sb-thread:make-thread
115  (lambda ()
116  (run-shell-command (if program
117  (format nil "alacritty ~A" program)
118  "alacritty")))))
119 
120 (defcommand blueberry () ()
121  (sb-thread:make-thread
122  (lambda ()
123  (run-shell-command "blueberry"))))
124 
125 (defcommand firefox () ()
126  "Run or raise Firefox."
127  (sb-thread:make-thread
128  (lambda () (run-or-raise "firefox" '(:class "Firefox") t nil))))
129 
130 (defcommand chromium () ()
131  (sb-thread:make-thread
132  (lambda ()
133  (run-or-raise "chromium" '(:class "Chromium") t nil))))
134 
135 (defcommand emacsclient () ()
136  (run-shell-command "emacsclient -c -a="))
137 
138 (defcommand homer () ()
139  (run-shell-command "homer"))
140 
141 (defcommand skel () ()
142  (run-shell-command "skel"))
143 
144 (define-key *root-map* (kbd "t") "term")
145 (define-key *root-map* (kbd "e") "emacsclient")
146 (define-key *root-map* (kbd "C-e") "emacs")
147 (define-key *root-map* (kbd "s-w") "chromium")