summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2022-12-31 23:20:53 +0100
committerjdlugosz963 <jdlugosz963@gmail.com>2022-12-31 23:20:53 +0100
commita3ab59de884a372226432ba50dd3c36e354ff22e (patch)
treeec96f030982b189b1a878bd2f0245253ee2c05f3
parent991712cc6a862e6166392ab8400cd67ee732f11d (diff)
downloaddotfiles-a3ab59de884a372226432ba50dd3c36e354ff22e.tar.gz
dotfiles-a3ab59de884a372226432ba50dd3c36e354ff22e.zip
Update Desktop config
-rw-r--r--.config/emacs/exwm/EXWM.desktop8
-rw-r--r--.config/emacs/exwm/desktop.el90
-rw-r--r--.config/emacs/exwm/start.sh4
-rw-r--r--.config/polybar/config.ini7
-rw-r--r--Desktop.org107
5 files changed, 151 insertions, 65 deletions
diff --git a/.config/emacs/exwm/EXWM.desktop b/.config/emacs/exwm/EXWM.desktop
deleted file mode 100644
index 1717437..0000000
--- a/.config/emacs/exwm/EXWM.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
1[Desktop Entry]
2Name=EXWM
3Comment=Emacs Window Manager
4Exec=sh /home/jakub/.config/emacs/exwm/start.sh
5TryExec=sh
6Type=Application
7X-LightDM-DesktopName=exwm
8DesktopNames=exwm
diff --git a/.config/emacs/exwm/desktop.el b/.config/emacs/exwm/desktop.el
index 579e6b2..512dbdc 100644
--- a/.config/emacs/exwm/desktop.el
+++ b/.config/emacs/exwm/desktop.el
@@ -5,13 +5,16 @@
5 (let ((command-parts (split-string command "[ ]+"))) 5 (let ((command-parts (split-string command "[ ]+")))
6 (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts))))) 6 (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
7 7
8(defun jd-exwm/exwm-init-hook () 8(defun jd-exwm/restart-process (program-name)
9 (display-battery-mode t) 9 (call-process "killall" nil nil nil program-name)
10 (display-time-mode t) 10 (jd-exwm/run-in-background program-name))
11 11
12 (jd-exwm/run-in-background "nm-applet") 12(defun jd-exwm/exwm-init-hook ()
13 (jd-exwm/run-in-background "pasystray") 13 (jd-exwm/restart-process "polybar")
14 (jd-exwm/run-in-background "blueman-applet")) 14 (jd-exwm/restart-process "nm-applet")
15 (jd-exwm/restart-process "redshift-gtk -l 54.37:18.6")
16 (jd-exwm/restart-process "blueman-applet")
17 (jd-exwm/restart-process "pasystray"))
15 18
16(defun jd-exwm/exwm-update-title () 19(defun jd-exwm/exwm-update-title ()
17 (exwm-workspace-rename-buffer exwm-title)) 20 (exwm-workspace-rename-buffer exwm-title))
@@ -20,6 +23,7 @@
20 (interactive) 23 (interactive)
21 (pcase exwm-class-name 24 (pcase exwm-class-name
22 ("firefox" (exwm-workspace-move-window 2)) 25 ("firefox" (exwm-workspace-move-window 2))
26 ("Brave" (exwm-workspace-move-window 2))
23 ("qutebrowser" (exwm-workspace-move-window 2)) 27 ("qutebrowser" (exwm-workspace-move-window 2))
24 ("discord" (exwm-workspace-move-window 5)) 28 ("discord" (exwm-workspace-move-window 5))
25 ("obs" (exwm-workspace-move-window 5)) 29 ("obs" (exwm-workspace-move-window 5))
@@ -27,29 +31,26 @@
27 31
28(use-package exwm 32(use-package exwm
29 :config 33 :config
30 (setq exwm-workspace-number 9) 34 (setq exwm-workspace-number 10)
31 35
32 (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook) 36 (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook)
33 (add-hook 'exwm-update-class-hook #'jd/exwm-update-class) 37 (add-hook 'exwm-update-class-hook #'jd/exwm-update-class)
34 (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title) 38 (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title)
35 (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class) 39 (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class)
36 40
37 (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap")
38 (start-process-shell-command "nitrogen" nil "nitrogen --restore") 41 (start-process-shell-command "nitrogen" nil "nitrogen --restore")
39 (start-process-shell-command "xinput" nil "xinput set-prop 11 336 1") 42 (start-process-shell-command "xinput" nil "xinput set-prop 'ETPS/2 Elantech Touchpad' 'Synaptics Tap Action' 1 1 1 2 1")
43 (start-process-shell-command "xmodmap" nil "xmodmap ~/dotfiles/.Xmodmap")
40 44
41 (require 'exwm-randr) 45 (require 'exwm-randr)
46 (setq exwm-randr-workspace-monitor-plist '(9 "eDP-1" 0 "eDP-1"))
42 (exwm-randr-enable) 47 (exwm-randr-enable)
43 ;; (start-process-shell-command "xrandr" nil "xrandr --output DP-1-8 --primary --mode 1920x1080 --output eDP-1 --off")
44
45 (require 'exwm-systemtray)
46 (exwm-systemtray-enable)
47 48
48 (setq exwm-input-simulation-keys 49 (setq exwm-input-simulation-keys
49 '(([?\C-l] . [left]) 50 '(([?\C-b] . [left])
50 ([?\C-h] . [right]) 51 ([?\C-f] . [right])
51 ([?\C-k] . [up]) 52 ([?\C-p] . [up])
52 ([?\C-j] . [down]))) 53 ([?\C-n] . [down])))
53 54
54 (setq exwm-input-prefix-keys 55 (setq exwm-input-prefix-keys
55 '(?\C-x 56 '(?\C-x
@@ -81,7 +82,7 @@
81 (lambda () 82 (lambda ()
82 (interactive) 83 (interactive)
83 (exwm-workspace-switch-create ,i)))) 84 (exwm-workspace-switch-create ,i))))
84 (number-sequence 1 9)))) 85 (number-sequence 0 9))))
85 86
86 (exwm-enable)) 87 (exwm-enable))
87 88
@@ -94,7 +95,56 @@
94 (desktop-environment-brightness-normal-increment "5%+") 95 (desktop-environment-brightness-normal-increment "5%+")
95 (desktop-environment-brightness-normal-decrement "5%-")) 96 (desktop-environment-brightness-normal-decrement "5%-"))
96 97
97(set-frame-parameter (selected-frame) 'alpha '(95 . 95)) 98(set-frame-parameter (selected-frame) 'alpha '(90 . 90))
98(add-to-list 'default-frame-alist `(alpha . (95 . 95))) 99(add-to-list 'default-frame-alist `(alpha . (90 . 90)))
99(set-frame-parameter (selected-frame) 'fullscreen 'maximized) 100(set-frame-parameter (selected-frame) 'fullscreen 'maximized)
100(add-to-list 'default-frame-alist '(fullscreen . maximized)) 101(add-to-list 'default-frame-alist '(fullscreen . maximized))
102
103(defun jd-exwm/get-color (ATTRIBUTE)
104 (face-attribute 'default ATTRIBUTE))
105
106(defun theme-to-xresources ()
107 (interactive)
108 (require 'term)
109 (with-temp-buffer
110 (insert "! Generated by theme-to-xresources\n")
111 (dolist (spec
112 '(("emacs.background" :background "E6")
113 ("emacs.foreground" :foreground "")))
114 (let ((color (jd-exwm/get-color (cadr spec))))
115 (insert (format "%s: #%s%s\n"
116 (car spec)
117 (caddr spec)
118 (string-remove-prefix "#" color))))
119 (write-region (point-min) (point-max) "~/.Xresources")))
120 (call-process "xrdb" nil nil nil "-merge" (expand-file-name "~/.Xresources")))
121
122(defun jd/theme-sync ()
123 (interactive)
124 (theme-to-xresources)
125 (setq org-confirm-babel-evaluate nil)
126 (org-babel-tangle-file "~/dotfiles/Desktop.org")
127 (setq org-confirm-babel-evaluate 't)
128 (call-process "killall" nil nil nil "dunst") ;; TODO: prevent clear notification history
129 (jd-exwm/restart-process "polybar"))
130
131(add-hook 'jd/load-theme-hook #'jd/theme-sync)
132(add-hook 'exwm-init-hook #'jd/theme-sync)
133
134(defun jd/dunst-show-history ()
135 (interactive)
136 (start-process-shell-command "dunstctl" nil "dunstctl history-pop"))
137
138(defun jd/dunst-close ()
139 (interactive)
140 (start-process-shell-command "dunstctl" nil "dunstctl close"))
141
142(defun jd/dunst-close-all ()
143 (interactive)
144 (start-process-shell-command "dunstctl" nil "dunstctl close-all"))
145
146(jd/leader-key-def
147 "d" '(nil :which-key "dunst")
148 "dh" '(jd/dunst-show-history :which-key "show history")
149 "dc" '(jd/dunst-close :which-key "close")
150 "da" '(jd/dunst-close-all :which-key "close all"))
diff --git a/.config/emacs/exwm/start.sh b/.config/emacs/exwm/start.sh
index 476d4b0..127e858 100644
--- a/.config/emacs/exwm/start.sh
+++ b/.config/emacs/exwm/start.sh
@@ -4,7 +4,9 @@ picom &
4 4
5xss-lock -- slock & 5xss-lock -- slock &
6 6
7export VISUAL=emacsclient 7export VISUAL="emacsclient -a vim"
8export EDITOR="$VISUAL" 8export EDITOR="$VISUAL"
9export GTK_THEME="Adwaita:dark"
10export CALIBRE_USE_DARK_PALETTE=1
9 11
10exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el 12exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el
diff --git a/.config/polybar/config.ini b/.config/polybar/config.ini
index 8e79a12..4af4e40 100644
--- a/.config/polybar/config.ini
+++ b/.config/polybar/config.ini
@@ -3,12 +3,9 @@ screenchange-reload = true
3pseudo-transparency = true 3pseudo-transparency = true
4 4
5[colors] 5[colors]
6background = #F20d1017 6background = ${xrdb:emacs.background}
7background-alt = #131721 7foreground = ${xrdb:emacs.foreground}
8foreground = #C5C8C6
9primary = #7fd962 8primary = #7fd962
10secondary = #bfbdb6
11alert = #A54242
12disabled = #707880 9disabled = #707880
13 10
14[bar/example] 11[bar/example]
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]