Switch to EXWM
authorAmin Bandali <bandali@gnu.org>
Mon, 12 Oct 2020 14:59:22 +0000 (10:59 -0400)
committerAmin Bandali <bandali@gnu.org>
Mon, 12 Oct 2020 15:03:44 +0000 (11:03 -0400)
(langa runs Parabola GNU/Linux-libre)

14 files changed:
.bashrc
.config/profiles/chaman [deleted file]
.config/profiles/darrud
.emacs.d/init.el
.emacs.d/lisp/bandali-exwm.el
.emacs.d/lisp/bandali-theme.el
.emacs.d/lisp/dmenu [new submodule]
.emacs.d/lisp/exwm [new submodule]
.emacs.d/lisp/exwm-edit [new submodule]
.emacs.d/lisp/refinery-theme [new submodule]
.emacs.d/lisp/xelb [new submodule]
.gitmodules
.profile
.xinitrc

diff --git a/.bashrc b/.bashrc
index 7e81de3..222a939 100644 (file)
--- a/.bashrc
+++ b/.bashrc
@@ -80,6 +80,7 @@ alias m="mbsync csclub; mbsync uwaterloo; mbsync shemshak; mbsync gnub"
 alias best="youtube-dl -f best"
 alias e="$EDITOR"
 alias se="SUDO_EDITOR=\"emacsclient\" sudo -e"
+alias s="startx"
 
 aur() {
    cd ~/usr/builds
diff --git a/.config/profiles/chaman b/.config/profiles/chaman
deleted file mode 100644 (file)
index 3b78e7b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-export IS_GUIX_SYSTEM=true
-
-if [ -x "$(command -v xinput)" ]; then
-   xinput --set-prop "TPPS/2 IBM TrackPoint" 'libinput Accel Speed' -0.4
-fi
-
-setxkbmap \
-    -layout us,ir \
-    -option ctrl:nocaps \
-    -option grp:shifts_toggle
-
-xmodmap -e "keysym Menu = Super_R"
-
-xsetroot -cursor_name left_ptr
-xset r rate 200 45
-xset b off
index 96cd9f8..4fa6735 100644 (file)
@@ -1 +1,2 @@
+# export IS_GUIX_SYSTEM=true
 export INFOPATH="$HOME/usr/local/share/info${INFOPATH:+:}$INFOPATH"
index e79d9f7..435cf97 100644 (file)
@@ -156,9 +156,9 @@ This sets each user option VAR's value to the corresponding VALUE.
        (yasnippet "0.14.0")
        (expand-region "0.11.0")
        ;; bndl
-       (refinery-theme "0.1.1")
+       ;; (refinery-theme "0.1.1")
        ;; Org ELPA
-       (org-plus-contrib "20201005"))))
+       (org-plus-contrib "20201012"))))
   (package-initialize))
 
 (csetq package-archive-upload-base "/ssh:caffeine:~/www/p/elpa")
@@ -565,7 +565,7 @@ Make N (default: 1) copies of the current line or region."
  (expand-file-name
   (convert-standard-filename "lisp") user-emacs-directory))
 
-;; (require 'bandali-exwm)
+(require 'bandali-exwm)
 
 (require 'bandali-org)
 
@@ -1005,9 +1005,11 @@ Make N (default: 1) copies of the current line or region."
 (add-hook 'latex-mode-hook #'reftex-mode)
 
 ;; dmenu
-;; (csetq
-;;  dmenu-prompt-string "run: "
-;;  dmenu-save-file (b/var "dmenu-items"))
+(add-to-list 'load-path (b/lisp "dmenu"))
+(with-eval-after-load 'dmenu
+  (csetq dmenu-prompt-string "run: "
+         dmenu-save-file (b/var "dmenu-items")))
+(autoload 'dmenu "dmenu" nil t)
 
 ;; eosd ?
 
index 6b57898..4395d61 100644 (file)
 
 ;;; Code:
 
-(use-package exwm
-  :if b/exwm-p
-  :demand
-  :config
-  ;; make class name the buffer name, truncating beyond 60 characters
-  (defun b/exwm-rename-buffer ()
-    (interactive)
-    (exwm-workspace-rename-buffer
-     (concat exwm-class-name ":"
-             (if (<= (length exwm-title) 60) exwm-title
-               (concat (substring exwm-title 0 59) "...")))))
-  ;; Enable EXWM
-  (exwm-enable)
-  :hook ((exwm-update-class . b/exwm-rename-buffer)
-         (exwm-update-title . b/exwm-rename-buffer)))
-
-(use-package exwm-config
-  :demand
-  :after exwm
-  :hook (exwm-init . exwm-config--fix/ido-buffer-window-other-frame))
-
-(use-package exwm-input
-  :demand
-  :after exwm
-  :config
-  (defun b/exwm-ws-prev-index ()
-    "Return the index for the previous EXWM workspace, wrapping
+(add-to-list 'load-path (b/lisp "xelb"))
+(add-to-list 'load-path (b/lisp "exwm"))
+(require 'exwm)
+;; make class name the buffer name, truncating beyond 60 characters
+(defun b/exwm-rename-buffer ()
+  (interactive)
+  (exwm-workspace-rename-buffer
+   (concat exwm-class-name ":"
+           (if (<= (length exwm-title) 60) exwm-title
+             (concat (substring exwm-title 0 59) "...")))))
+;; Enable EXWM
+(exwm-enable)
+(add-hook 'exwm-update-class-hook #'b/exwm-rename-buffer)
+(add-hook 'exwm-update-title-hook #'b/exwm-rename-buffer)
+
+(require 'exwm-config)
+(add-hook 'exwm-init-hook #'exwm-config--fix/ido-buffer-window-other-frame)
+
+(require 'exwm-input)
+(defun b/exwm-ws-prev-index ()
+  "Return the index for the previous EXWM workspace, wrapping
 around if needed."
-    (if (= exwm-workspace-current-index 0)
-        (1- exwm-workspace-number)
-      (1- exwm-workspace-current-index)))
+  (if (= exwm-workspace-current-index 0)
+      (1- exwm-workspace-number)
+    (1- exwm-workspace-current-index)))
 
-  (defun b/exwm-ws-next-index ()
-    "Return the index for the next EXWM workspace, wrapping
+(defun b/exwm-ws-next-index ()
+  "Return the index for the next EXWM workspace, wrapping
 around if needed."
-    (if (= exwm-workspace-current-index
-           (1- exwm-workspace-number))
-        0
-      (1+ exwm-workspace-current-index)))
-
-  ;; shorten 'C-c C-q' to 'C-q'
-  (define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
-
-  (setq exwm-workspace-number 4
-        exwm-input-global-keys
-        `(([?\s-R] . exwm-reset)
-          ([?\s-\\] . exwm-workspace-switch)
-          ([?\s-\s] . dmenu)
-          ([?\S-\s-\s] . (lambda (command)
-                              (interactive
-                               (list (read-shell-command "➜ ")))
-                              (start-process-shell-command
-                               command nil command)))
-          ([s-return] . (lambda ()
+  (if (= exwm-workspace-current-index
+         (1- exwm-workspace-number))
+      0
+    (1+ exwm-workspace-current-index)))
+
+;; shorten 'C-c C-q' to 'C-q'
+(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
+
+(csetq exwm-workspace-number 4
+       exwm-input-global-keys
+       `(([?\s-R] . exwm-reset)
+         ([?\s-\\] . exwm-workspace-switch)
+         ([?\s-\s] . dmenu)
+         ([?\S-\s-\s] . (lambda (command)
+                          (interactive
+                           (list (read-shell-command "➜ ")))
+                          (start-process-shell-command
+                           command nil command)))
+         ([s-return] . (lambda ()
+                         (interactive)
+                         (start-process "" nil "urxvt")))
+         ([?\C-\s-\s] . counsel-linux-app)
+         ([?\M-\s-\s] . (lambda ()
                           (interactive)
-                          (start-process "" nil "urxvt")))
-          ([?\C-\s-\s] . counsel-linux-app)
-          ([?\M-\s-\s] . (lambda ()
-                           (interactive)
-                           (start-process-shell-command
-                            "rofi-pass" nil "rofi-pass")))
-          ([?\s-h] . windmove-left)
-          ([?\s-j] . windmove-down)
-          ([?\s-k] . windmove-up)
-          ([?\s-l] . windmove-right)
-          ([?\s-H] . windmove-swap-states-left)
-          ([?\s-J] . windmove-swap-states-down)
-          ([?\s-K] . windmove-swap-states-up)
-          ([?\s-L] . windmove-swap-states-right)
-          ([?\M-\s-h] . shrink-window-horizontally)
-          ([?\M-\s-l] . enlarge-window-horizontally)
-          ([?\M-\s-k] . shrink-window)
-          ([?\M-\s-j] . enlarge-window)
-          ([?\s-\[] . (lambda ()
-                        (interactive)
-                        (exwm-workspace-switch-create
-                         (b/exwm-ws-prev-index))))
-          ([?\s-\]] . (lambda ()
-                        (interactive)
-                        (exwm-workspace-switch-create
-                         (b/exwm-ws-next-index))))
-          ([?\s-{] . (lambda ()
+                          (start-process-shell-command
+                           "rofi-pass" nil "rofi-pass")))
+         ([?\s-h] . windmove-left)
+         ([?\s-j] . windmove-down)
+         ([?\s-k] . windmove-up)
+         ([?\s-l] . windmove-right)
+         ([?\s-H] . windmove-swap-states-left)
+         ([?\s-J] . windmove-swap-states-down)
+         ([?\s-K] . windmove-swap-states-up)
+         ([?\s-L] . windmove-swap-states-right)
+         ([?\M-\s-h] . shrink-window-horizontally)
+         ([?\M-\s-l] . enlarge-window-horizontally)
+         ([?\M-\s-k] . shrink-window)
+         ([?\M-\s-j] . enlarge-window)
+         ([?\s-\[] . (lambda ()
                        (interactive)
-                       (exwm-workspace-move-window
+                       (exwm-workspace-switch-create
                         (b/exwm-ws-prev-index))))
-          ([?\s-}] . (lambda ()
+         ([?\s-\]] . (lambda ()
                        (interactive)
-                       (exwm-workspace-move-window
+                       (exwm-workspace-switch-create
                         (b/exwm-ws-next-index))))
-          ,@(mapcar (lambda (i)
-                      `(,(kbd (format "s-%d" i)) .
-                        (lambda ()
-                          (interactive)
-                          (exwm-workspace-switch-create ,i))))
-                    (number-sequence 0 (1- exwm-workspace-number)))
-          ([?\s-t] . exwm-floating-toggle-floating)
-          ([?\s-f] . exwm-layout-toggle-fullscreen)
-          ([?\s-W] . (lambda ()
-                       (interactive)
-                       (kill-buffer (current-buffer))))
-          ([?\s-Q] . (lambda ()
+         ([?\s-{] . (lambda ()
+                      (interactive)
+                      (exwm-workspace-move-window
+                       (b/exwm-ws-prev-index))))
+         ([?\s-}] . (lambda ()
+                      (interactive)
+                      (exwm-workspace-move-window
+                       (b/exwm-ws-next-index))))
+         ,@(mapcar (lambda (i)
+                     `(,(kbd (format "s-%d" i)) .
+                       (lambda ()
+                         (interactive)
+                         (exwm-workspace-switch-create ,i))))
+                   (number-sequence 0 (1- exwm-workspace-number)))
+         ([?\s-t] . exwm-floating-toggle-floating)
+         ([?\s-f] . exwm-layout-toggle-fullscreen)
+         ([?\s-W] . (lambda ()
+                      (interactive)
+                      (kill-buffer (current-buffer))))
+         ([?\s-Q] . (lambda ()
+                      (interactive)
+                      (exwm-manage--kill-client)))
+         ([?\s-\'] . (lambda ()
                        (interactive)
-                       (exwm-manage--kill-client)))
-          ([?\s-\'] . (lambda ()
-                        (interactive)
-                        (start-process-shell-command
-                         "rofi-light" nil "rofi-light")))
-          ([XF86AudioMute] .
-           (lambda ()
-             (interactive)
-             (start-process "" nil "amixer" "set" "'Master',0" "toggle")))
-          ([XF86AudioLowerVolume] .
-           (lambda ()
-             (interactive)
-             (start-process
-              "" nil "amixer" "set" "'Master',0" "5%-")))
-          ([XF86AudioRaiseVolume] .
-           (lambda ()
-             (interactive)
-             (start-process
-              "" nil "amixer" "set" "'Master',0" "5%+")))
-          ([XF86AudioPlay] .
-           (lambda ()
-             (interactive)
-             (start-process "" nil "mpc" "toggle")))
-          ([XF86AudioPrev] .
-           (lambda ()
-             (interactive)
-             (start-process "" nil "mpc" "prev")))
-          ([XF86AudioNext] .
-           (lambda ()
-             (interactive)
-             (start-process "" nil "mpc" "next")))
-          ([XF86ScreenSaver] .
-           (lambda ()
-                    (interactive)
-                    (start-process "" nil "dm-tool" "lock")))
-          ([\s-XF86Back] . previous-buffer)
-          ([\s-XF86Forward] . next-buffer)))
-
-  ;; Line-editing shortcuts
-  (setq exwm-input-simulation-keys
-    '(;; movement
-      ([?\C-b] . [left])
-      ([?\M-b] . [C-left])
-      ([?\C-f] . [right])
-      ([?\M-f] . [C-right])
-      ([?\C-p] . [up])
-      ([?\C-n] . [down])
-      ([?\C-a] . [home])
-      ([?\C-e] . [end])
-      ([?\M-v] . [prior])
-      ([?\C-v] . [next])
-      ([?\C-d] . [delete])
-      ([?\C-k] . [S-end ?\C-x])
-      ([?\M-<] . C-home)
-      ([?\M->] . C-end)
-      ;; cut/copy/paste
-      ([?\C-w] . [?\C-x])
-      ([?\M-w] . [?\C-c])
-      ([?\C-y] . [?\C-v])
-      ([?\M-d] . [C-S-right ?\C-x])
-      ([?\M-\d] . [C-S-left ?\C-x])
-      ;; window
-      ([?\s-w] . [?\C-w])
-      ([?\s-q] . [?\C-q])
-      ;; misc
-      ([?\C-s] . [?\C-f])
-      ([?\s-s] . [?\C-s])
-      ([?\C-g] . [escape]))))
-
-(use-package exwm-manage
-  :demand
-  :after exwm
-  :hook
-  (exwm-manage-finish . (lambda ()
-                          (when exwm-class-name
-                            (cond
-                             ((string= exwm-class-name "IceCat")
-                              (exwm-input-set-local-simulation-keys
-                               `(,@exwm-input-simulation-keys
-                                 ([?\C-\S-d] . [?\C-d]))))
-                             ((string= exwm-class-name "URxvt")
-                              (exwm-input-set-local-simulation-keys
-                               '(([?\C-c ?\C-c] . [?\C-c])
-                                 ([?\C-c ?\C-u] . [?\C-u]))))
-                             ((string= exwm-class-name "Zathura")
-                              (exwm-input-set-local-simulation-keys
-                               '(([?\C-p] . [C-up])
-                                 ([?\C-n] . [C-down])))))))))
-
-(use-package exwm-randr
-  :demand
-  :after exwm
-  :config
-  (exwm-randr-enable)
-  :custom
-  (exwm-randr-workspace-monitor-plist '(1 "VGA-1")))
-
-(use-package exwm-systemtray
-  :demand
-  :after exwm
-  :config
-  (exwm-systemtray-enable))
-
-(use-package exwm-workspace)
-
-(use-package exwm-edit
-  :demand
-  :after exwm)
+                       (start-process-shell-command
+                        "rofi-light" nil "rofi-light")))
+         ([XF86AudioMute] .
+          (lambda ()
+            (interactive)
+            (start-process "" nil "amixer" "set" "'Master',0" "toggle")))
+         ([XF86AudioLowerVolume] .
+          (lambda ()
+            (interactive)
+            (start-process
+             "" nil "amixer" "set" "'Master',0" "5%-")))
+         ([XF86AudioRaiseVolume] .
+          (lambda ()
+            (interactive)
+            (start-process
+             "" nil "amixer" "set" "'Master',0" "5%+")))
+         ([XF86AudioPlay] .
+          (lambda ()
+            (interactive)
+            (start-process "" nil "mpc" "toggle")))
+         ([XF86AudioPrev] .
+          (lambda ()
+            (interactive)
+            (start-process "" nil "mpc" "prev")))
+         ([XF86AudioNext] .
+          (lambda ()
+            (interactive)
+            (start-process "" nil "mpc" "next")))
+         ([XF86ScreenSaver] .
+          (lambda ()
+                   (interactive)
+                   (start-process "" nil "dm-tool" "lock")))
+         ([\s-XF86Back] . previous-buffer)
+         ([\s-XF86Forward] . next-buffer)))
+
+;; Line-editing shortcuts
+(csetq exwm-input-simulation-keys
+       '(;; movement
+         ([?\C-b] . [left])
+         ([?\M-b] . [C-left])
+         ([?\C-f] . [right])
+         ([?\M-f] . [C-right])
+         ([?\C-p] . [up])
+         ([?\C-n] . [down])
+         ([?\C-a] . [home])
+         ([?\C-e] . [end])
+         ([?\M-v] . [prior])
+         ([?\C-v] . [next])
+         ([?\C-d] . [delete])
+         ([?\C-k] . [S-end ?\C-x])
+         ([?\M-<] . C-home)
+         ([?\M->] . C-end)
+         ;; cut/copy/paste
+         ([?\C-w] . [?\C-x])
+         ([?\M-w] . [?\C-c])
+         ([?\C-y] . [?\C-v])
+         ([?\M-d] . [C-S-right ?\C-x])
+         ([?\M-\d] . [C-S-left ?\C-x])
+         ;; window
+         ([?\s-w] . [?\C-w])
+         ([?\s-q] . [?\C-q])
+         ;; misc
+         ([?\C-s] . [?\C-f])
+         ([?\s-s] . [?\C-s])
+         ([?\C-g] . [escape])))
+
+(require 'exwm-manage)
+(add-hook 'exwm-manage-finish-hook
+          (lambda ()
+            (when exwm-class-name
+              (cond
+               ((string= exwm-class-name "IceCat")
+                (exwm-input-set-local-simulation-keys
+                 `(,@exwm-input-simulation-keys
+                   ([?\C-\S-d] . [?\C-d]))))
+               ((string= exwm-class-name "URxvt")
+                (exwm-input-set-local-simulation-keys
+                 '(([?\C-c ?\C-c] . [?\C-c])
+                   ([?\C-c ?\C-u] . [?\C-u]))))
+               ((string= exwm-class-name "Zathura")
+                (exwm-input-set-local-simulation-keys
+                 '(([?\C-p] . [C-up])
+                   ([?\C-n] . [C-down]))))))))
+
+(require 'exwm-randr)
+(exwm-randr-enable)
+(csetq exwm-randr-workspace-monitor-plist '(1 "VGA-1"))
+
+(require 'exwm-systemtray)
+(exwm-systemtray-enable)
+
+(add-to-list 'load-path (b/lisp "exwm-edit"))
+(require 'exwm-edit)
 
 (provide 'bandali-exwm)
 ;;; bandali-exwm.el ends here
index c63234a..63c15d0 100644 (file)
@@ -24,6 +24,7 @@
 
 ;;; Code:
 
+(add-to-list 'load-path (b/lisp "refinery-theme"))
 (with-eval-after-load 'package
   (require 'refinery-theme)
   (load-theme 'refinery t))
diff --git a/.emacs.d/lisp/dmenu b/.emacs.d/lisp/dmenu
new file mode 160000 (submodule)
index 0000000..e8cc9b2
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit e8cc9b27c79d3ecc252267c082ab8e9c82eab264
diff --git a/.emacs.d/lisp/exwm b/.emacs.d/lisp/exwm
new file mode 160000 (submodule)
index 0000000..0368127
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 0368127976bda29d35eed788edfe74644ecd3845
diff --git a/.emacs.d/lisp/exwm-edit b/.emacs.d/lisp/exwm-edit
new file mode 160000 (submodule)
index 0000000..2fd9426
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 2fd9426922c8394ec8d21c50dcc20b7d03af21e4
diff --git a/.emacs.d/lisp/refinery-theme b/.emacs.d/lisp/refinery-theme
new file mode 160000 (submodule)
index 0000000..761ecca
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit 761ecca31d91cf55addab93d44aae1066ea77b02
diff --git a/.emacs.d/lisp/xelb b/.emacs.d/lisp/xelb
new file mode 160000 (submodule)
index 0000000..df102a5
--- /dev/null
@@ -0,0 +1 @@
+Subproject commit df102a5773b37cec154e795a17a8513144dde643
index d07bc54..b689be6 100644 (file)
 [submodule "scpaste"]
        path = .emacs.d/lisp/scpaste
        url = https://git.sr.ht/~technomancy/scpaste
+[submodule "refinery-theme"]
+       path = .emacs.d/lisp/refinery-theme
+       url = https://git.emacsconf.org/bandali/refinery-theme
+[submodule "xelb"]
+       path = .emacs.d/lisp/xelb
+       url = https://github.com/ch11ng/xelb
+[submodule "exwm"]
+       path = .emacs.d/lisp/exwm
+       url = https://github.com/ch11ng/exwm
+[submodule "exwm-edit"]
+       path = .emacs.d/lisp/exwm-edit
+       url = https://github.com/agzam/exwm-edit
+[submodule "dmenu"]
+       path = .emacs.d/lisp/dmenu
+       url = https://github.com/lujun9972/el-dmenu
index 11aaabe..96c67fb 100644 (file)
--- a/.profile
+++ b/.profile
@@ -94,5 +94,3 @@ fi
 # see https://docs.xfce.org/xfce/xfce4-session/advanced#ssh_and_gpg_agents
 # also, MATE does something similar with gnome-keyring-daemon:
 # http://william.shallum.net/random-notes/disabling-gnome-keyring-daemon-ssh-agent-on-mate-desktop
-
-export PATH="$HOME/.cargo/bin:$PATH"
index c2feb42..b0e828e 100644 (file)
--- a/.xinitrc
+++ b/.xinitrc
@@ -1 +1,18 @@
 [ -f ~/.Xresources ] && xrdb -merge ~/.Xresources
+
+if [ -x "$(command -v xinput)" ]; then
+   xinput --set-prop "TPPS/2 IBM TrackPoint" 'libinput Accel Speed' -0.4
+fi
+
+setxkbmap \
+    -layout us,ir \
+    -option ctrl:nocaps \
+    -option grp:shifts_toggle
+
+xmodmap -e "keysym Menu = Super_R"
+
+xsetroot -cursor_name left_ptr
+xset r rate 200 45
+xset b off
+
+exec emacs -ib 0