-
Notifications
You must be signed in to change notification settings - Fork 0
/
.stumpwmrc
167 lines (128 loc) · 4.49 KB
/
.stumpwmrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
(in-package :stumpwm)
(ql:quickload :clx-truetype)
(ql:quickload :cl-diskspace)
(ql:quickload :cl-mount-info)
;; Modules
;; (init-load-path "~/.stumpwm.d/modules")
(load-module "disk")
(load-module "cpu")
(load-module "mem")
(load-module "pianobar")
(load-module "end-session")
(load-module "ttf-fonts")
;; Fonts
(setf xft:*font-dirs* '("~/.guix-profile/share/fonts/truetype/"))
(setf clx-truetype:cache-font-file (concat (getenv "HOME") "/.fonts/font-cache.sexp"))
(xft:cache-fonts)
(clx-truetype:cache-fonts)
(set-font (make-instance 'xft:font :family "Fira Code" :subfamily "Regular" :size 12))
;; Variables
(defparameter *background-color* "#000F14")
(set-bg-color *background-color*)
(setf *default-bg-color* *background-color*
*win-bg-color* *background-color*
*window-border-style* :none
*hidden-window-color* "^**"
*mouse-focus-policy* :click
*mode-line-pad-x* 3
*mode-line-pad-y* 3
*float-window-modifier* :SUPER)
;; Modeline
(defparameter cpu::*cpu-modeline-fmt* "%c")
(defparameter mem::*mem-modeline-fmt* "MEM: %p")
(setf *mode-line-background-color* *background-color*
*mode-line-foreground-color* "#FFFFFF"
*mode-line-border-color* "#555555"
*mode-line-border-width* 1
*mode-line-position* :top
*mode-line-timeout* 1
*mode-line-highlight-template* "~A·"
*time-modeline-string* "%a %b %e %k:%M"
*window-format* "%m%n%s%c")
(setf *screen-mode-line-format* (list "[^B%n^b] [%C %M %D] [%W]^>%P · %d"))
(mode-line)
;; Commands
(defcommand hsplit-and-term () ()
(hsplit)
(move-focus :right)
(run-shell-command "kitty"))
(defcommand vsplit-and-term () ()
(vsplit)
(move-focus :down)
(run-shell-command "kitty"))
(defcommand kill-and-remove-split () ()
(let ((window (current-window)))
(remove-split)
(delete-window window)))
(defcommand gnew-and-term () ()
(run-commands "gnew")
(run-shell-command "kitty"))
(defcommand gkill-windows-and-group () ()
(let* ((group (current-group))
(group-windows (group-windows group)))
(gkill)
(mapcar #'delete-window group-windows)))
(defcommand emacsclient () ()
(hsplit)
(move-focus :right)
(run-or-raise "emacsclient -c --frame-parameters='(quote (name . \"emacsclient\"))'" '(:title "emacsclient" :class "emacsclient" :instance "emacsclient")))
(defcommand midnight-commander () ()
(hsplit)
(move-focus :right)
(run-shell-command "kitty --name mc mc"))
(defun setup-workspace-emacs ()
(grename "emacs")
(define-frame-preference "emacs"
(0 t t :title "Emacs"))
(emacs))
(defun setup-workspace-monitoring ()
(gnewbg "monitoring")
(define-frame-preference "monitoring"
(0 nil t :instance "btop"))
(run-or-raise "kitty --name btop btop" '(:instance "btop")))
(defun setup-workspace-firefox ()
(gnewbg "firefox")
(define-frame-preference "firefox"
(0 t t :class "firefox"))
(run-shell-command "firefox"))
(defun setup-workspace-llm ()
(gnewbg "llm")
(define-frame-preference "llm"
(0 nil t :instance "llama"))
(define-frame-preference "llm"
(0 nil t :instance "radeontop"))
(run-or-raise "kitty --name llama /home/enzuru/bin/llama" '(:instance "llama"))
(vsplit)
(run-or-raise "kitty --name radeontop radeontop" '(:instance "radeontop")))
(defcommand setup-workspaces () ()
(run-shell-command (format nil "xsetroot -solid \"~$\"" *background-color*))
(setup-workspace-emacs)
(setup-workspace-monitoring)
;; (setup-workspace-llm)
(setup-workspace-firefox))
;; tmux emulation
;;; Emacs
(define-key *root-map* (kbd "e") "emacsclient")
(define-key *root-map* (kbd "E") "emacs")
(define-key *root-map* (kbd "f") "midnight-commander")
;;; Windows
(define-key *root-map* (kbd "b") "windowlist")
(define-key *root-map* (kbd "Left") "pull-hidden-next")
(define-key *root-map* (kbd "Right") "pull-hidden-previous")
;;; Groups
(define-key *root-map* (kbd "T") "grouplist")
(define-key *root-map* (kbd "c") "gnew-and-term")
(define-key *root-map* (kbd "n") "gnext")
(define-key *root-map* (kbd "p") "gprev")
(define-key *root-map* (kbd "&") "gkill-windows-and-group")
;;; Frames
(define-key *root-map* (kbd "1") "only")
(define-key *root-map* (kbd "0") "remove-split")
(define-key *root-map* (kbd "2") "vsplit-and-term")
(define-key *root-map* (kbd "3") "hsplit-and-term")
(define-key *root-map* (kbd "o") "next")
(define-key *root-map* (kbd "%") "hsplit-and-term")
(define-key *root-map* (kbd "\"") "vsplit-and-term")
(define-key *root-map* (kbd "x") "kill-and-remove-split")
(when *initializing*
(setup-workspaces))