summaryrefslogtreecommitdiffstats
path: root/.config
diff options
context:
space:
mode:
authorjdlugosz963 <jdlugosz963@gmail.com>2022-09-21 20:53:30 +0200
committerjdlugosz963 <jdlugosz963@gmail.com>2022-09-21 20:53:30 +0200
commit8e9d2ec5a8aa966b7ada92fe9c4a5bfc80979e57 (patch)
treee411daa136a558ebebdab3e3b9b4ac3696ab79e4 /.config
parent3edfc2e08b00d66babc743ebc4c75d9a4507832a (diff)
downloaddotfiles-8e9d2ec5a8aa966b7ada92fe9c4a5bfc80979e57.tar.gz
dotfiles-8e9d2ec5a8aa966b7ada92fe9c4a5bfc80979e57.zip
Add EXWM config
Diffstat (limited to '.config')
-rw-r--r--.config/emacs/exwm/EXWM.desktop8
-rw-r--r--.config/emacs/exwm/Xmodmap2
-rw-r--r--.config/emacs/exwm/desktop.el100
-rw-r--r--.config/emacs/exwm/start.sh10
4 files changed, 120 insertions, 0 deletions
diff --git a/.config/emacs/exwm/EXWM.desktop b/.config/emacs/exwm/EXWM.desktop
new file mode 100644
index 0000000..1717437
--- /dev/null
+++ b/.config/emacs/exwm/EXWM.desktop
@@ -0,0 +1,8 @@
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/Xmodmap b/.config/emacs/exwm/Xmodmap
new file mode 100644
index 0000000..cb4706f
--- /dev/null
+++ b/.config/emacs/exwm/Xmodmap
@@ -0,0 +1,2 @@
1clear lock
2keycode 0x42 = Escape
diff --git a/.config/emacs/exwm/desktop.el b/.config/emacs/exwm/desktop.el
new file mode 100644
index 0000000..1643961
--- /dev/null
+++ b/.config/emacs/exwm/desktop.el
@@ -0,0 +1,100 @@
1(defun jd/exwm-update-class ()
2 (exwm-workspace-rename-buffer exwm-class-name))
3
4(defun jd-exwm/run-in-background (command)
5 (let ((command-parts (split-string command "[ ]+")))
6 (apply #'call-process `(,(car command-parts) nil 0 nil ,@(cdr command-parts)))))
7
8(defun jd-exwm/exwm-init-hook ()
9 (display-battery-mode t)
10 (display-time-mode t)
11
12 (jd-exwm/run-in-background "nm-applet")
13 (jd-exwm/run-in-background "pasystray")
14 (jd-exwm/run-in-background "blueman-applet"))
15
16(defun jd-exwm/exwm-update-title ()
17 (exwm-workspace-rename-buffer exwm-title))
18
19(defun jd-exwm/configure-window-by-class ()
20 (interactive)
21 (pcase exwm-class-name
22 ("firefox" (exwm-workspace-move-window 2))
23 ("qutebrowser" (exwm-workspace-move-window 2))
24 ("discord" (exwm-workspace-move-window 5))
25 ("obs" (exwm-workspace-move-window 5))
26 ("Virt-manager" (exwm-workspace-move-window 4))))
27
28(use-package exwm
29 :config
30 (setq exwm-workspace-number 9)
31
32 (add-hook 'exwm-init-hook #'jd-exwm/exwm-init-hook)
33 (add-hook 'exwm-update-class-hook #'jd/exwm-update-class)
34 (add-hook 'exwm-update-title-hook #'jd-exwm/exwm-update-title)
35 (add-hook 'exwm-manage-finish-hook #'jd-exwm/configure-window-by-class)
36
37 (start-process-shell-command "xmodmap" nil "xmodmap ~/.config/emacs/exwm/Xmodmap")
38 (start-process-shell-command "nitrogen" nil "nitrogen --restore")
39 (start-process-shell-command "xinput" nil "xinput set-prop 11 336 1")
40
41 (require 'exwm-randr)
42 (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 (setq exwm-input-simulation-keys
49 '(([?\C-l] . [left])
50 ([?\C-h] . [right])
51 ([?\C-k] . [up])
52 ([?\C-j] . [down])))
53
54 (setq exwm-input-prefix-keys
55 '(?\C-x
56 ?\C-u
57 ?\C-h
58 ?\M-x
59 ?\M-`
60 ?\M-&
61 ?\M-:
62 ?\C-\M-j
63 ?\C-\ ))
64
65 (define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
66 (exwm-input-set-key (kbd "s-p") 'counsel-linux-app)
67
68 (setq exwm-input-global-keys
69 `(([?\s-R] . exwm-reset)
70
71
72 ([?\s-r] . (lambda (command)
73 (interactive (list (read-shell-command "$ ")))
74 (start-process-shell-command command nil command)))
75
76 ([?\s-W] . exwm-workspace-move-window)
77 ([?\s-w] . exwm-workspace-switch)
78
79 ,@(mapcar (lambda (i)
80 `(,(kbd (format "s-%d" i)) .
81 (lambda ()
82 (interactive)
83 (exwm-workspace-switch-create ,i))))
84 (number-sequence 1 9))))
85
86 (exwm-enable))
87
88(use-package desktop-environment
89 :after exwm
90 :config (desktop-environment-mode)
91 :custom
92 (desktop-environment-brightness-small-increment "2%+")
93 (desktop-environment-brightness-small-decrement "2%-")
94 (desktop-environment-brightness-normal-increment "5%+")
95 (desktop-environment-brightness-normal-decrement "5%-"))
96
97(set-frame-parameter (selected-frame) 'alpha '(95 . 95))
98(add-to-list 'default-frame-alist `(alpha . (95 . 95)))
99(set-frame-parameter (selected-frame) 'fullscreen 'maximized)
100(add-to-list 'default-frame-alist '(fullscreen . maximized))
diff --git a/.config/emacs/exwm/start.sh b/.config/emacs/exwm/start.sh
new file mode 100644
index 0000000..476d4b0
--- /dev/null
+++ b/.config/emacs/exwm/start.sh
@@ -0,0 +1,10 @@
1#!/bin/sh
2
3picom &
4
5xss-lock -- slock &
6
7export VISUAL=emacsclient
8export EDITOR="$VISUAL"
9
10exec dbus-launch --exit-with-session emacs -mm --debug-init -l ~/.config/emacs/exwm/desktop.el