changelog shortlog graph tags branches changeset files revisions annotate raw help

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

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