diff options
author | jdlugosz963 <jdlugosz963@gmail.com> | 2022-12-31 23:20:53 +0100 |
---|---|---|
committer | jdlugosz963 <jdlugosz963@gmail.com> | 2022-12-31 23:20:53 +0100 |
commit | a3ab59de884a372226432ba50dd3c36e354ff22e (patch) | |
tree | ec96f030982b189b1a878bd2f0245253ee2c05f3 /Desktop.org | |
parent | 991712cc6a862e6166392ab8400cd67ee732f11d (diff) | |
download | dotfiles-a3ab59de884a372226432ba50dd3c36e354ff22e.tar.gz dotfiles-a3ab59de884a372226432ba50dd3c36e354ff22e.zip |
Update Desktop config
Diffstat (limited to 'Desktop.org')
-rw-r--r-- | Desktop.org | 107 |
1 files changed, 76 insertions, 31 deletions
diff --git a/Desktop.org b/Desktop.org index 04d6be3..e24607e 100644 --- a/Desktop.org +++ b/Desktop.org | |||
@@ -15,13 +15,16 @@ | |||
15 | (let ((command-parts (split-string command "[ ]+"))) | 15 | (let ((command-parts (split-string command "[ ]+"))) |
16 | (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) | 16 | (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) |
17 | 17 | ||
18 | (defun jd-exwm/exwm-init-hook () | 18 | (defun jd-exwm/restart-process (program-name) |
19 | (display-battery-mode t) | 19 | (call-process "killall" nil nil nil program-name) |
20 | (display-time-mode t) | 20 | (jd-exwm/run-in-background program-name)) |
21 | 21 | ||
22 | (jd-exwm/run-in-background "nm-applet") | 22 | (defun jd-exwm/exwm-init-hook () |
23 | (jd-exwm/run-in-background "pasystray") | 23 | (jd-exwm/restart-process "polybar") |
24 | (jd-exwm/run-in-background "blueman-applet")) | 24 | (jd-exwm/restart-process "nm-applet") |
25 | (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6") | ||
26 | (jd-exwm/restart-process "blueman-applet") | ||
27 | (jd-exwm/restart-process "pasystray")) | ||
25 | 28 | ||
26 | (defun jd-exwm/exwm-update-title () | 29 | (defun jd-exwm/exwm-update-title () |
27 | (exwm-workspace-rename-buffer exwm-title)) | 30 | (exwm-workspace-rename-buffer exwm-title)) |
@@ -30,6 +33,7 @@ | |||
30 | (interactive) | 33 | (interactive) |
31 | (pcase exwm-class-name | 34 | (pcase exwm-class-name |
32 | ("firefox" (exwm-workspace-move-window 2)) | 35 | ("firefox" (exwm-workspace-move-window 2)) |
36 | ("Brave" (exwm-workspace-move-window 2)) | ||
33 | ("qutebrowser" (exwm-workspace-move-window 2)) | 37 | ("qutebrowser" (exwm-workspace-move-window 2)) |
34 | ("discord" (exwm-workspace-move-window 5)) | 38 | ("discord" (exwm-workspace-move-window 5)) |
35 | ("obs" (exwm-workspace-move-window 5)) | 39 | ("obs" (exwm-workspace-move-window 5)) |
@@ -37,29 +41,26 @@ | |||
37 | 41 | ||
38 | (use-package exwm | 42 | (use-package exwm |
39 | :config | 43 | :config |
40 | (setq exwm-workspace-number 9) | 44 | (setq exwm-workspace-number 10) |
41 | 45 | ||
42 | (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) | 46 | (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) |
43 | (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) | 47 | (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) |
44 | (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) | 48 | (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) |
45 | (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) | 49 | (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) |
46 | 50 | ||
47 | (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap") | ||
48 | (start-process-shell-command "nitrogen" nil "nitrogen --restore") | 51 | (start-process-shell-command "nitrogen" nil "nitrogen --restore") |
49 | (start-process-shell-command "xinput" nil "xinput set-prop 11 336 1") | 52 | (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1") |
53 | (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap") | ||
50 | 54 | ||
51 | (require 'exwm-randr) | 55 | (require 'exwm-randr) |
56 | (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1")) | ||
52 | (exwm-randr-enable) | 57 | (exwm-randr-enable) |
53 | ;; (start-process-shell-command "xrandr" nil "xrandr --output DP-1-8 --primary --mode 1920x1080 --output eDP-1 --off") | ||
54 | |||
55 | (require 'exwm-systemtray) | ||
56 | (exwm-systemtray-enable) | ||
57 | 58 | ||
58 | (setq exwm-input-simulation-keys | 59 | (setq exwm-input-simulation-keys |
59 | '(([?\C-l] . [left]) | 60 | '(([?\C-b] . [left]) |
60 | ([?\C-h] . [right]) | 61 | ([?\C-f] . [right]) |
61 | ([?\C-k] . [up]) | 62 | ([?\C-p] . [up]) |
62 | ([?\C-j] . [down]))) | 63 | ([?\C-n] . [down]))) |
63 | 64 | ||
64 | (setq exwm-input-prefix-keys | 65 | (setq exwm-input-prefix-keys |
65 | '(?\C-x | 66 | '(?\C-x |
@@ -91,7 +92,7 @@ | |||
91 | (lambda () | 92 | (lambda () |
92 | (interactive) | 93 | (interactive) |
93 | (exwm-workspace-switch-create ,i)))) | 94 | (exwm-workspace-switch-create ,i)))) |
94 | (number-sequence 1 9)))) | 95 | (number-sequence 0 9)))) |
95 | 96 | ||
96 | (exwm-enable)) | 97 | (exwm-enable)) |
97 | 98 | ||
@@ -115,13 +116,49 @@ | |||
115 | 116 | ||
116 | #+begin_src emacs-lisp | 117 | #+begin_src emacs-lisp |
117 | 118 | ||
118 | (set-frame-parameter (selected-frame) 'alpha '(95 . 95)) | 119 | (set-frame-parameter (selected-frame) 'alpha '(90 . 90)) |
119 | (add-to-list 'default-frame-alist `(alpha . (95 . 95))) | 120 | (add-to-list 'default-frame-alist `(alpha . (90 . 90))) |
120 | (set-frame-parameter (selected-frame) 'fullscreen 'maximized) | 121 | (set-frame-parameter (selected-frame) 'fullscreen 'maximized) |
121 | (add-to-list 'default-frame-alist '(fullscreen . maximized)) | 122 | (add-to-list 'default-frame-alist '(fullscreen . maximized)) |
122 | 123 | ||
123 | #+end_src | 124 | #+end_src |
124 | 125 | ||
126 | ** Update colorsheme | ||
127 | #+begin_src emacs-lisp | ||
128 | |||
129 | (defun jd-exwm/get-color (ATTRIBUTE) | ||
130 | (face-attribute 'default ATTRIBUTE)) | ||
131 | |||
132 | (defun theme-to-xresources () | ||
133 | (interactive) | ||
134 | (require 'term) | ||
135 | (with-temp-buffer | ||
136 | (insert "! Generated by theme-to-xresources\n") | ||
137 | (dolist (spec | ||
138 | '(("emacs.background" :background "E6") | ||
139 | ("emacs.foreground" :foreground ""))) | ||
140 | (let ((color (jd-exwm/get-color (cadr spec)))) | ||
141 | (insert (format "%s: #%s%s\n" | ||
142 | (car spec) | ||
143 | (caddr spec) | ||
144 | (string-remove-prefix "#" color)))) | ||
145 | (write-region (point-min) (point-max) "~/.Xresources"))) | ||
146 | (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources"))) | ||
147 | |||
148 | (defun jd/theme-sync () | ||
149 | (interactive) | ||
150 | (theme-to-xresources) | ||
151 | (setq org-confirm-babel-evaluate nil) | ||
152 | (org-babel-tangle-file "~/dotfiles/Desktop.org") | ||
153 | (setq org-confirm-babel-evaluate 't) | ||
154 | (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history | ||
155 | (jd-exwm/restart-process "polybar")) | ||
156 | |||
157 | (add-hook 'jd/load-theme-hook #'jd/theme-sync) | ||
158 | (add-hook 'exwm-init-hook #'jd/theme-sync) | ||
159 | |||
160 | |||
161 | #+end_src | ||
125 | ** Start emacs | 162 | ** Start emacs |
126 | 163 | ||
127 | #+begin_src sh :tangle ~/.config/emacs/exwm/start.sh | 164 | #+begin_src sh :tangle ~/.config/emacs/exwm/start.sh |
@@ -131,8 +168,10 @@ | |||
131 | 168 | ||
132 | xss-lock -- slock & | 169 | xss-lock -- slock & |
133 | 170 | ||
134 | export VISUAL=emacsclient | 171 | export VISUAL="emacsclient -a vim" |
135 | export EDITOR="$VISUAL" | 172 | export EDITOR="$VISUAL" |
173 | export GTK_THEME="Adwaita:dark" | ||
174 | export CALIBRE_USE_DARK_PALETTE=1 | ||
136 | 175 | ||
137 | exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el | 176 | exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el |
138 | 177 | ||
@@ -163,13 +202,21 @@ | |||
163 | 202 | ||
164 | #+end_src | 203 | #+end_src |
165 | 204 | ||
205 | *Get emacs colors* | ||
206 | #+NAME: get-color | ||
207 | #+BEGIN_SRC elisp :var ATTR="" :tangle no :eval yes | ||
208 | (if (and (stringp ATTR) (s-prefix-p ":" ATTR)) | ||
209 | (jd-exwm/get-color (intern ATTR)) | ||
210 | "") | ||
211 | #+END_SRC | ||
212 | |||
166 | *dunstrc* | 213 | *dunstrc* |
167 | 214 | ||
168 | #+begin_src conf :tangle .config/dunst/dunstrc | 215 | #+begin_src conf :tangle .config/dunst/dunstrc :noweb yes :eval yes |
169 | 216 | ||
170 | [global] | 217 | [global] |
171 | frame_width = 2 | 218 | frame_width = 2 |
172 | frame_color = "#39bae6" | 219 | frame_color = "<<get-color(":foreground")>>" |
173 | font = sourcecodepro | 220 | font = sourcecodepro |
174 | 221 | ||
175 | # Allow a small subset of html markup: | 222 | # Allow a small subset of html markup: |
@@ -324,15 +371,15 @@ | |||
324 | [urgency_low] | 371 | [urgency_low] |
325 | # IMPORTANT: colors have to be defined in quotation marks. | 372 | # IMPORTANT: colors have to be defined in quotation marks. |
326 | # Otherwise the "#" and following would be interpreted as a comment. | 373 | # Otherwise the "#" and following would be interpreted as a comment. |
327 | background "#0d1017" | 374 | background = "<<get-color(":background")>>" |
328 | foreground = "#888888" | 375 | foreground = "#888888" |
329 | timeout = 10 | 376 | timeout = 10 |
330 | # Icon for notifications with low urgency, uncomment to enable | 377 | # Icon for notifications with low urgency, uncomment to enable |
331 | #icon = /path/to/icon | 378 | #icon = /path/to/icon |
332 | 379 | ||
333 | [urgency_normal] | 380 | [urgency_normal] |
334 | background = "#1e2128" | 381 | background = "<<get-color(":background")>>" |
335 | foreground = "#ffffff" | 382 | foreground = "<<get-color(":foreground")>>" |
336 | timeout = 10 | 383 | timeout = 10 |
337 | # Icon for notifications with normal urgency, uncomment to enable | 384 | # Icon for notifications with normal urgency, uncomment to enable |
338 | #icon = /path/to/icon | 385 | #icon = /path/to/icon |
@@ -347,6 +394,7 @@ | |||
347 | #+end_src | 394 | #+end_src |
348 | 395 | ||
349 | * Polybar | 396 | * Polybar |
397 | |||
350 | #+begin_src conf :tangle .config/polybar/config.ini | 398 | #+begin_src conf :tangle .config/polybar/config.ini |
351 | 399 | ||
352 | [settings] | 400 | [settings] |
@@ -354,12 +402,9 @@ | |||
354 | pseudo-transparency = true | 402 | pseudo-transparency = true |
355 | 403 | ||
356 | [colors] | 404 | [colors] |
357 | background = #F20d1017 | 405 | background = ${xrdb:emacs.background} |
358 | background-alt = #131721 | 406 | foreground = ${xrdb:emacs.foreground} |
359 | foreground = #C5C8C6 | ||
360 | primary = #7fd962 | 407 | primary = #7fd962 |
361 | secondary = #bfbdb6 | ||
362 | alert = #A54242 | ||
363 | disabled = #707880 | 408 | disabled = #707880 |
364 | 409 | ||
365 | [bar/example] | 410 | [bar/example] |