Browse Source

Remove exwm and eyebrowse

master
Peter J. Jones 4 months ago
parent
commit
4edfb6e9de
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
16 changed files with 13 additions and 396 deletions
  1. 0
    28
      bin/exwm
  2. 0
    12
      lisp/functions.el
  3. 0
    8
      lisp/keys.el
  4. 0
    1
      lisp/modes.el
  5. 0
    1
      lisp/options.el
  6. 3
    1
      lisp/themes.el
  7. 8
    76
      modes/browse-url-conf.el
  8. 0
    3
      modes/evil-conf.el
  9. 0
    139
      modes/exwm-conf.el
  10. 0
    15
      modes/eyebrowse-conf.el
  11. 2
    2
      modes/ivy-conf.el
  12. 0
    24
      nix/exwm-nw.nix
  13. 0
    25
      nix/exwm.nix
  14. 0
    26
      nix/ivy-exwm.nix
  15. 0
    10
      nix/packages.nix
  16. 0
    25
      nix/xelb.nix

+ 0
- 28
bin/exwm View File

@@ -1,28 +0,0 @@
1
-#!/bin/sh
2
-
3
-################################################################################
4
-# A script to start the Emacs X Window Manager (EXWM).
5
-set -e
6
-
7
-################################################################################
8
-# Disable access control:
9
-xhost "+SI:localuser:$USER"
10
-
11
-# Make Java applications aware this is a non-reparenting window manager:
12
-export _JAVA_AWT_WM_NONREPARENTING=1
13
-
14
-# Some variables that can be overridden:
15
-EMACS_BIN=${EMACS_BIN:=@emacspath@/emacs}
16
-EMACS_SERVER_NAME=${EMACS_SERVER_NAME:=server}
17
-
18
-# Create a FIFO for a KDE Plasmoid I use:
19
-plasmoid=$HOME/.cache/emacs/plasmoid
20
-rm -f "$plasmoid" && mkfifo -m 0600 "$plasmoid"
21
-
22
-# Start Emacs:
23
-exec "$EMACS_BIN" \
24
-     --eval "(setq server-name \"$EMACS_SERVER_NAME\")" \
25
-     --eval "(require 'exwm)" \
26
-     -f server-start \
27
-     -f exwm-enable \
28
-     "$@"

+ 0
- 12
lisp/functions.el View File

@@ -10,18 +10,6 @@
10 10
      frame 0 frame "_NET_WM_STATE" 32
11 11
      '(1 "_NET_WM_STATE_DEMANDS_ATTENTION" 0)))
12 12
 
13
-(defun pjones:plasmoid-update ()
14
-  "Update a KDE plasmoid that is blocked reading from a FIFO."
15
-  (let ((inhibit-message t)
16
-        (file (concat user-emacs-directory "plasmoid"))
17
-        (desktop (exwm-nw--format exwm-workspace-current-index))
18
-        (eyebrowse (let* ((slot (eyebrowse--get 'current-slot))
19
-                          (cfgs (eyebrowse--get 'window-configs)))
20
-                     (eyebrowse-format-slot (assoc slot cfgs)))))
21
-    (with-temp-buffer
22
-      (insert (concat desktop " | " eyebrowse "\n"))
23
-      (write-region nil nil file t))))
24
-
25 13
 (defun pjones:define-keys-from-hydra (keymap heads)
26 14
   "Define keys in KEYMAP from HEADS."
27 15
   (dolist (head heads)

+ 0
- 8
lisp/keys.el View File

@@ -79,13 +79,6 @@
79 79
   (define-key map (kbd "p") #'passmm-completing-read)
80 80
   (define-key map (kbd "l") #'passmm-list-passwords))
81 81
 
82
-(let ((map pjones:w-map))
83
-  (define-key map (kbd "'")   #'eyebrowse-last-window-config)
84
-  (define-key map (kbd "SPC") #'eyebrowse-switch-to-window-config)
85
-  (define-key map (kbd "c")   #'eyebrowse-create-window-config)
86
-  (define-key map (kbd "n")   #'eyebrowse-rename-window-config)
87
-  (define-key map (kbd "x")   #'eyebrowse-close-window-config))
88
-
89 82
 ;; User bindings under C-c:
90 83
 (global-set-key (kbd "C-c b")   pjones:b-map)
91 84
 (global-set-key (kbd "C-c c") #'pjones:projectile-compile-project)
@@ -99,7 +92,6 @@
99 92
 (global-set-key (kbd "C-c m") #'magit-status)
100 93
 (global-set-key (kbd "C-c p")   pjones:p-map)
101 94
 (global-set-key (kbd "C-c t") #'org-mru-clock-in)
102
-(global-set-key (kbd "C-c w")   pjones:w-map)
103 95
 
104 96
 ;; Evil and evil-leader:
105 97
 ;; These need to be set before loading Evil.

+ 0
- 1
lisp/modes.el View File

@@ -18,7 +18,6 @@
18 18
 (unless noninteractive
19 19
   ;; Global minor modes:
20 20
   (winner-mode)                           ; Track win conifg changes
21
-  (eyebrowse-mode)                        ; Named window configurations
22 21
   (projectile-mode)                       ; Project tool
23 22
   (global-auto-revert-mode)               ; External changes cause a revert
24 23
   (shackle-mode)                          ; Control pop-up windows.

+ 0
- 1
lisp/options.el View File

@@ -49,7 +49,6 @@
49 49
 ;; Settings not worth their own file in the modes directory:
50 50
 (custom-set-variables
51 51
  '(epa-file-encrypt-to "204284CB")    ; Default GPG key to use
52
- '(epa-pinentry-mode 'loopback)       ; Needed for EXWM.
53 52
  '(compilation-scroll-output 'first-error)
54 53
  `(custom-file ,(concat user-emacs-directory "custom.el"))) ; To keep Emacs happy
55 54
 

+ 3
- 1
lisp/themes.el View File

@@ -5,7 +5,9 @@
5 5
 ;;    Code to activate my preferred themes.
6 6
 ;;
7 7
 ;;; Code:
8
-(load-theme 'doom-city-lights t)
8
+(if (display-graphic-p)
9
+    (load-theme 'doom-city-lights t)
10
+  (load-theme 'doom-one t))
9 11
 
10 12
 ;; Stolen from: https://github.com/alezost/emacs-config
11 13
 (defun pjones:load-theme (theme)

+ 8
- 76
modes/browse-url-conf.el View File

@@ -1,87 +1,19 @@
1 1
 ;;; browse-url-conf.el -- Settings for browse-url.
2
-(eval-when-compile
3
-  (require 'browse-url))
4
-
2
+;;
3
+;;; Commentary:
4
+;;
5
+;;; Code:
5 6
 ;; Dependencies.
6
-(require 'exwm)
7 7
 (require 'async)
8
-(require 'browse-url) ;; If `C-z o' loads this file.
9
-
10
-;; FIXME: Turn this into a minor-mode.
11
-
12
-(defvar pjones:url-shortcuts
13
-  '("http://duckduckgo.com/?q=%s"
14
-    "http://www.google.com/search?q=%s"
15
-    "http://en.wikipedia.org/w/index.php?title=Special:Search&search=%s&go=Go")
16
-;; FIXME: add hoogle, hackage, imdb, amazon, etc.
17
-  "Custom URLs that will have %s replaced with a search string.")
18
-
19
-;; Taken from exwm-surf: Copyright (C) 2017 craven@gmx.net
20
-(defun exwm-surf-set-prop (prop winid value)
21
-  "Set property PROP on X window WINID to VALUE."
22
-  (start-process-shell-command "xprop" nil (format "xprop -id %s -f %s 8s -set %s \"%s\"" winid prop prop value)))
23
-
24
-;; Taken from exwm-surf: Copyright (C) 2017 craven@gmx.net
25
-(defun exwm-surf-get-prop (prop winid)
26
-  "Read property PROP from X window WINID."
27
-  (let ((text (shell-command-to-string (format "xprop -notype -id %s %s" winid prop))))
28
-    (string-match "\"\\(.*\\)\"" text)
29
-    (match-string 1 text)))
8
+(require 'browse-url)
30 9
 
31 10
 (defun pjones:browse-url-browser-function (url &optional new-window &rest args)
32 11
   "Open URL in a external browser.
33
-
34 12
 If NEW-WINDOW is non-nil then always open a new browsers window.
35 13
 Other arguments in ARGS are ignored."
36 14
   (interactive)
37
-  (if (and (derived-mode-p 'exwm-mode) (not new-window))
38
-      (cond
39
-       ((string= exwm-class-name "Surf")
40
-        (exwm-surf-set-prop "_SURF_GO" (exwm--buffer->id (current-buffer)) url))
41
-       (t (async-start-process "surf" "surf" nil url)))
42
-  (async-start-process "firefox" "firefox" nil "--new-window" url)))
43
-
44
-(defun pjones:extract-url-from-surf ()
45
-  "Extract the URL from the Surf window.
46
-
47
-Assumes the current window is a Surf window."
48
-  (let ((winid (if (derived-mode-p 'exwm-mode)
49
-                    (exwm--buffer->id (current-buffer))
50
-                  (error "Not an exwm window"))))
51
-    (exwm-surf-get-prop "_SURF_URI" winid)))
52
-
53
-(defun pjones:browse-url-prompt ()
54
-  "Prompt for a URL.
55
-
56
-If the current window is a browser, extract a URL from it."
57
-  (let ((prompt "URL: ")
58
-        (default (when (derived-mode-p 'exwm-mode)
59
-                   (cond
60
-                    ((string= exwm-class-name "Surf")
61
-                     (pjones:extract-url-from-surf))))))
62
-    (if default (list (read-string prompt default)
63
-                      (not (eq (null browse-url-new-window-flag)
64
-                               (null current-prefix-arg))))
65
-      (browse-url-interactive-arg prompt))))
66
-
67
-(defun pjones:browse-url (url &rest args)
68
-  "Ask a browser to display URL.
69
-
70
-If URL is nil, prompt for it.  ARGS are passed to the real
71
-`browse-url' unchanged."
72
-  (interactive (pjones:browse-url-prompt))
73
-  (browse-url url (car args)))
74
-
75
-(defun pjones:browse-url-shortcut (new-window)
76
-  "Browse a URL after picking a shortcut.
77
-
78
-Prompts for a shortcut and search string.  If NEW-WINDOW is
79
-non-nil then display the URL in a new window."
80
-  (interactive "P")
81
-  (let* ((shortcut (completing-read "Shortcut: " pjones:url-shortcuts))
82
-         (url (if (string-match-p "%s" shortcut)
83
-                  (format shortcut (read-string "Search: "))
84
-                shortcut)))
85
-    (browse-url url new-window)))
15
+  (async-start-process "firefox" "firefox" nil "--new-window" url))
86 16
 
87 17
 (setq browse-url-browser-function #'pjones:browse-url-browser-function)
18
+
19
+;;; browse-url-conf.el ends here

+ 0
- 3
modes/evil-conf.el View File

@@ -16,9 +16,6 @@
16 16
  '(evil-lookup-func #'man)
17 17
  '(evil-symbol-word-search t))
18 18
 
19
-;; EXWM settings:
20
-(evil-set-initial-state 'exwm-mode 'emacs)
21
-
22 19
 (defun pjones:evil-update-cursor ()
23 20
   "Change the cursor to match the evil state."
24 21
   (let* ((cursor

+ 0
- 139
modes/exwm-conf.el View File

@@ -1,139 +0,0 @@
1
-;;; exwm-conf.el -- Setting for EXWM.
2
-;;
3
-;;; Commentary:
4
-;;
5
-;; Functions and settings for EXWM:
6
-;;   https://github.com/ch11ng/exwm
7
-;;
8
-;;; Code:
9
-(require 'exwm)
10
-(require 'cl-lib)
11
-(require 'exwm-nw)
12
-(require 'exwm-randr)
13
-
14
-;###############################################################################
15
-;;
16
-;;; Custom EXWM functions:
17
-;;
18
-;###############################################################################
19
-(defun pjones:exwm-manage-finish-hook ()
20
-  "Hook run when a new X window is managed by EXWM.")
21
-
22
-(defun pjones:exwm-update-class-hook ()
23
-  "Hook run when a window's class name changed."
24
-  (exwm-workspace-rename-buffer exwm-class-name))
25
-
26
-(defun pjones:exwm-workspace-switch-hook ()
27
-  "Hook run when changing workspaces."
28
-  (pjones:plasmoid-update))
29
-
30
-(defmacro pjones:exwm-switch-to (n)
31
-  "Create a function that will switch to workspace N."
32
-  `(lambda () (interactive) (exwm-workspace-switch-create ,n)))
33
-
34
-;###############################################################################
35
-;;
36
-;;; Settings:
37
-;;
38
-;###############################################################################
39
-(custom-set-variables ;; Common settings:
40
-   ;; Workspace settings:
41
-  '(exwm-workspace-number 10)
42
-  '(exwm-randr-workspace-output-plist nil)
43
-  '(exwm-workspace-show-all-buffers nil)
44
-  '(exwm-layout-show-all-buffers nil)
45
-  '(exwm-workspace-minibuffer-position nil)
46
-  '(exwm-workspace-display-echo-area-timeout 1)
47
-  '(exwm-workspace-warp-cursor t)
48
-
49
-  ;; Floating windows:
50
-  '(exwm-manage-force-tiling t)
51
-  '(exwm-floating-border-width 3)
52
-  '(exwm-floating-border-color "#ff52bb")
53
-
54
-  ;; Global key bindings:
55
-  '(exwm-input-prefix-keys
56
-    (list ?\C-w ?\C-x ?\C-u ?\C-h ?\C-c ?\M-x ?\M-& ?\M-:))
57
-
58
-  `(exwm-input-global-keys
59
-    (quote ((,(kbd "s-r")        . exwm-reset)
60
-            (,(kbd "s-o")        . other-frame)
61
-            (,(kbd "s-z")        . exwm-workspace-switch)
62
-            (,(kbd "s-n")        . exwm-nw-set-name)
63
-            (,(kbd "s-SPC")      . exwm-nw-find-workspace)
64
-            (,(kbd "s-'")        . exwm-nw-goto-previous)
65
-
66
-            ;; Switch workspaces with the super key:
67
-            (,(kbd "s-;") . ,(pjones:exwm-switch-to 0))
68
-            (,(kbd "s-a") . ,(pjones:exwm-switch-to 1))
69
-            (,(kbd "s-s") . ,(pjones:exwm-switch-to 2))
70
-            (,(kbd "s-d") . ,(pjones:exwm-switch-to 3))
71
-            (,(kbd "s-f") . ,(pjones:exwm-switch-to 4))
72
-            (,(kbd "s-g") . ,(pjones:exwm-switch-to 5))
73
-            (,(kbd "s-h") . ,(pjones:exwm-switch-to 6))
74
-            (,(kbd "s-j") . ,(pjones:exwm-switch-to 7))
75
-            (,(kbd "s-k") . ,(pjones:exwm-switch-to 8))
76
-            (,(kbd "s-l") . ,(pjones:exwm-switch-to 9)))))
77
-
78
-  ;; Simulated key presses to X Windows:
79
-  '(exwm-input-simulation-keys
80
-    '(([?\C-c ?\C-c] . [?\C-c])
81
-      ([?\C-p]       . [up])
82
-      ([?\C-n]       . [down]))))
83
-
84
-
85
-(define-key exwm-workspace--switch-map (kbd "s-z")     #'exwm-nw-goto-previous)
86
-(define-key exwm-workspace--switch-map (kbd "C-z C-z") #'exwm-nw-goto-previous)
87
-(define-key exwm-workspace--switch-map (kbd "C-c C-b") #'exwm-nw-move-left)
88
-(define-key exwm-workspace--switch-map (kbd "C-c C-f") #'exwm-nw-move-right)
89
-(define-key exwm-workspace--switch-map (kbd "C-c C-n") #'exwm-nw-set-name)
90
-(define-key exwm-workspace--switch-map (kbd "C-s")     #'exwm-nw-find-workspace)
91
-(define-key exwm-workspace--switch-map (kbd "C-u")     #'universal-argument)
92
-
93
-;###############################################################################
94
-;;
95
-;;; Activate optional features:
96
-;;
97
-;###############################################################################
98
-(exwm-randr-enable)
99
-(exwm-nw-mode)
100
-
101
-;###############################################################################
102
-;;
103
-;;; Evil integration
104
-;;
105
-;###############################################################################
106
-;; See also: evil-conf.el
107
-;; FIXME: do some proper evil config here.
108
-
109
-;###############################################################################
110
-;;
111
-;;; Logging Out
112
-;;
113
-;###############################################################################
114
-(defun pjones:exwm-logout ()
115
-  "Exit Emacs and logout."
116
-  (interactive)
117
-  (when (yes-or-no-p "Really exit EXWM and KDE? ")
118
-    (save-some-buffers)
119
-    (run-hooks 'kill-emacs-hook)
120
-    (start-process-shell-command
121
-     "logout" nil
122
-     "qdbus org.kde.ksmserver /KSMServer logout 0 3 3")))
123
-
124
-(defun pjones:exwm-set-logout-binding ()
125
-  "Set up the logout key binding."
126
-  (global-set-key (kbd "C-x C-c") #'pjones:exwm-logout))
127
-
128
-;###############################################################################
129
-;;
130
-;;; Insert some hooks:
131
-;;
132
-;###############################################################################
133
-(add-hook 'exwm-update-class-hook     #'pjones:exwm-update-class-hook)
134
-(add-hook 'exwm-manage-finish-hook    #'pjones:exwm-manage-finish-hook)
135
-(add-hook 'exwm-workspace-switch-hook #'pjones:exwm-workspace-switch-hook)
136
-(add-hook 'exwm-init-hook             #'pjones:exwm-set-logout-binding)
137
-;; (add-hook 'exwm-init-hook             #'desktop-save-mode)
138
-
139
-;;; exwm-conf.el ends here

+ 0
- 15
modes/eyebrowse-conf.el View File

@@ -1,15 +0,0 @@
1
-;;; eyebrowse-conf.el -- Settings for eyebrowse.
2
-;;
3
-;;; Commentary:
4
-;;
5
-;;; Code:
6
-(require 'eyebrowse)
7
-
8
-(custom-set-variables
9
- '(eyebrowse-wrap-around t)
10
- '(eyebrowse-new-workspace t))
11
-
12
-(declare-function pjones:plasmoid-update "../lisp/functions.el")
13
-(add-hook 'eyebrowse-post-window-switch-hook #'pjones:plasmoid-update)
14
-
15
-;;; eyebrowse-conf.el ends here

+ 2
- 2
modes/ivy-conf.el View File

@@ -38,8 +38,8 @@
38 38
  '(ivy-current-match ((t (:inherit 'isearch)))))
39 39
 
40 40
 ;; Enable complementary modes:
41
-(require 'ivy-exwm)
42
-(ivy-exwm-mode 1)
41
+(require 'ivy-rich)
42
+(ivy-rich-mode 1)
43 43
 
44 44
 (defun pjones:ivy-ignore-buffers (buffer)
45 45
   "Ignore BUFFER if it meets certain criteria."

+ 0
- 24
nix/exwm-nw.nix View File

@@ -1,24 +0,0 @@
1
-{ super
2
-, self
3
-, pkgs
4
-, melpaBuild
5
-}:
6
-
7
-melpaBuild {
8
-  pname = "exwm-nw";
9
-  version = "0.1";
10
-
11
-  src = pkgs.fetchgit {
12
-    url = "git://git.devalot.com/exwm-nw.git";
13
-    rev = "ada2cf7874a925d2b83b9735de25594e75520219";
14
-    sha256 = "0kbbry6fdx4wagn1nhah9cshp7p1yl7fnp35rnvy24k06nibds1a";
15
-  };
16
-
17
-  recipe = pkgs.writeText "recipe" ''
18
-    (exwm-nw :repo "pjones/exwm-nw" :fetcher github)
19
-  '';
20
-
21
-  packageRequires = [
22
-    self.exwm
23
-  ];
24
-}

+ 0
- 25
nix/exwm.nix View File

@@ -1,25 +0,0 @@
1
-{ self
2
-, pkgs
3
-, melpaBuild
4
-, ...
5
-}:
6
-
7
-melpaBuild {
8
-  pname = "exwm";
9
-  version = "0.21.20190102";
10
-
11
-  src = pkgs.fetchFromGitHub {
12
-    owner  = "ch11ng";
13
-    repo   = "exwm";
14
-    rev    = "404c94568d581fb66fca5e2524c908d63188388";
15
-    sha256 = "1081aqlp7g6h7r1lrlkab97npn5w9kmnafh2lmcb9hskp0ydfiym";
16
-  };
17
-
18
-  recipe = pkgs.writeText "recipe" ''
19
-    (exwm :repo "ch11ng/exwm" :fetcher github)
20
-  '';
21
-
22
-  packageRequires = [
23
-    self.xelb
24
-  ];
25
-}

+ 0
- 26
nix/ivy-exwm.nix View File

@@ -1,26 +0,0 @@
1
-{ super
2
-, self
3
-, pkgs
4
-, melpaBuild
5
-}:
6
-
7
-melpaBuild {
8
-  pname = "ivy-exwm";
9
-  version = "0.1";
10
-
11
-  src = pkgs.fetchgit {
12
-    url = "git://git.devalot.com/ivy-exwm.git";
13
-    rev = "32f107374aef01b9ae00f1647233d50b4ea659e0";
14
-    sha256 = "1shs1zh8nr2lwxlvrhnhxxjn5g0p21vkjxnjgha1sn07pg7v3iqq";
15
-  };
16
-
17
-  recipe = pkgs.writeText "recipe" ''
18
-    (ivy-exwm :repo "pjones/ivy-exwm" :fetcher github)
19
-  '';
20
-
21
-  packageRequires = [
22
-    self.exwm
23
-    super.ivy
24
-    super.ivy-rich
25
-  ];
26
-}

+ 0
- 10
nix/packages.nix View File

@@ -20,13 +20,7 @@ let
20 20
     projectile = self.melpaPackages.projectile;
21 21
 
22 22
     # Newer versions of existing packages:
23
-    exwm = import ./exwm.nix { inherit super self pkgs melpaBuild; };
24
-    xelb = import ./xelb.nix { inherit super self pkgs melpaBuild; };
25 23
     mu4e-query-fragments = import ./mu4e-query-fragments.nix { inherit super self pkgs melpaBuild; };
26
-
27
-    # My custom packages:
28
-    exwm-nw  = import ./exwm-nw.nix  { inherit super self pkgs melpaBuild; };
29
-    ivy-exwm = import ./ivy-exwm.nix { inherit super self pkgs melpaBuild; };
30 24
     passmm   = import ./passmm.nix   { inherit super self pkgs melpaBuild; };
31 25
   });
32 26
 
@@ -61,9 +55,6 @@ overrides.emacsWithPackages (epkgs: with epkgs; [
61 55
   evil-magit
62 56
   evil-org
63 57
   evil-surround
64
-  exwm
65
-  exwm-nw
66
-  eyebrowse
67 58
   flycheck
68 59
   git-annex
69 60
   graphviz-dot-mode
@@ -76,7 +67,6 @@ overrides.emacsWithPackages (epkgs: with epkgs; [
76 67
   indium
77 68
   inf-ruby
78 69
   ivy
79
-  ivy-exwm
80 70
   ivy-hydra
81 71
   ivy-rich
82 72
   js2-mode

+ 0
- 25
nix/xelb.nix View File

@@ -1,25 +0,0 @@
1
-{ pkgs
2
-, melpaBuild
3
-, self
4
-, ...
5
-}:
6
-
7
-melpaBuild {
8
-  pname = "xelb";
9
-  version = "0.16.20190102";
10
-
11
-  src = pkgs.fetchFromGitHub {
12
-    owner = "ch11ng";
13
-    repo  = "xelb";
14
-    rev   = "407cce8dd8b0e621449c6c3015c303539f53819";
15
-    sha256 = "0pf20jbhszv5p0ncd0y3smx0c2im3xslid4r62whr55x1mq27mr9";
16
-  };
17
-
18
-  recipe = pkgs.writeText "recipe" ''
19
-    (xelb :repo "ch11ng/xelb" :fetcher github)
20
-  '';
21
-
22
-  packageRequires = [
23
-    self.cl-generic
24
-  ];
25
-}

Loading…
Cancel
Save