summaryrefslogtreecommitdiff
path: root/.config/emacs/modules/bd--exwm-windowing.el
diff options
context:
space:
mode:
Diffstat (limited to '.config/emacs/modules/bd--exwm-windowing.el')
-rw-r--r--.config/emacs/modules/bd--exwm-windowing.el92
1 files changed, 21 insertions, 71 deletions
diff --git a/.config/emacs/modules/bd--exwm-windowing.el b/.config/emacs/modules/bd--exwm-windowing.el
index 1dc5056..ab5b243 100644
--- a/.config/emacs/modules/bd--exwm-windowing.el
+++ b/.config/emacs/modules/bd--exwm-windowing.el
@@ -19,68 +19,20 @@
(desktop-environment-volume-increment-slowly "+2%")
(desktop-environment-volume-toggle-regexp nil))
-
-(defun bd/exwm-update-class ()
- "Changes the buffer name to reflect the class name for
-that buffer."
- (exwm-workspace-rename-buffer exwm-class-name))
-
-(defun bd/exwm-init-hook ()
- "Make workspace 1 the default startup workspace."
- (exwm-workspace-switch-create 1))
-
-
-;;;; bookmarks, passwords
-(defun insert-bookmark ()
- "Inserts a url or string from permanent
-bookmark file. If an x window, place in kill-ring."
- ;; note xdotool had issues with repeated keys when sending to windowid
- (interactive)
- (let ((url (car (last (split-string (choose-line-from-file "~/.local/bin/bookmarks.txt"))))))
- (if (exwm--buffer->id (current-buffer))
- (kill-new url)
- (insert url))))
-
-(defun choose-line-from-file (file)
- "Uses completion-framework to allow user to
-select a line from a file."
- (let* ((choices (read-file-into-list file)))
- (completing-read "Recall: " choices)))
-
-(defun read-file-into-list (file)
- (with-current-buffer
- (find-file-noselect file)
- (split-string
- (save-restriction
- (widen)
- (buffer-substring-no-properties
- (point-min)
- (point-max)))
- "\n" t)))
-
-(use-package password-store
- :custom
- (password-store-time-before-clipboard-restore 20))
-
(use-package exwm
:config
- (add-hook 'exwm-init-hook #'bd/exwm-init-hook)
- (add-hook 'exwm-update-class-hook #'bd/exwm-update-class)
- ;; order is important
- ;; (dolist (k '(("s-B" "icecat")))
- ;; (let ((f (lambda () (interactive)
- ;; (save-window-excursion
- ;; (start-process-shell-command (cadr k) nil (cadr k))))))
- ;; (exwm-input-set-key (kbd (car k)) f)
- ;; (define-key exwm-mode-map (kbd (car k)) f)))
+ (defun bd/exwm-update-title ()
+ "Changes the buffer name to reflect the class name for
+that buffer."
+ (exwm-workspace-rename-buffer exwm-title))
+ (add-hook 'exwm-update-title-hook #'bd/exwm-update-title)
(define-key exwm-mode-map [?\C-q] 'exwm-input-send-next-key)
(exwm-enable)
(server-start)
:custom
- (exwm-workspace-number 2) ;; two workspaces
(exwm-input-prefix-keys
- '(?\C-x
+ `(?\C-x
?\C-u
?\C-g
?\C-h
@@ -90,9 +42,11 @@ select a line from a file."
?\M-`
?\M-&
?\M-:
- ))
+ ,@(mapcar (lambda (i)
+ (kbd (concat "s-" (number-to-string i))))
+ (number-sequence 0 9))))
(exwm-input-global-keys
- `(([?\s-n] . other-window)
+ '(([?\s-n] . other-window)
([?\s-p] . (lambda ()
(interactive)
(other-window -1)))
@@ -107,20 +61,14 @@ select a line from a file."
([f10] . emms-next)
([print] . desktop-environment-screenshot-part)
([S-print] . desktop-environment-screenshot)
- ([?\s-O] . insert-bookmark)
- ([?\s-P] . password-store-copy)
+ ([?\s-O] . bd/visit-bookmark)
+ ([?\s-P] . bd/password)
([?\s-r] . exwm-reset)
([?\s-d] . toggle-current-window-dedication)
([?\s-q] . kill-current-buffer)
([?\s-x] . (lambda (command)
(interactive (list (read-shell-command "s-x ")))
- (start-process-shell-command command nil command)))
- ,@(mapcar (lambda (i)
- `(,(kbd (format "s-%d" i)) .
- (lambda ()
- (interactive)
- (exwm-workspace-switch-create ,i))))
- (number-sequence 0 9))))
+ (start-process-shell-command command nil command)))))
(exwm-input-simulation-keys
'(([?\C-b] . [left])
([?\C-f] . [right])
@@ -133,10 +81,12 @@ select a line from a file."
([?\C-d] . [delete])
([?\C-k] . [S-end delete])
([?\M-w] . [C-c])
- ([?\C-y] . [C-v])))
+ ([?\C-y] . [C-v])
+ ([?\M-d] . [C-delete])
+ ([?\M-b] . [C-left])
+ ([?\M-f] . [C-right]))))
- (exwm-workspace-show-all-buffers t)
- (exwm-layout-show-all-buffers t))
+(setopt tab-bar-select-tab-modifiers '(super))
(defvar new-mode-line nil)
(defun set-new-mode-line ()
@@ -145,9 +95,9 @@ select a line from a file."
(replace-regexp-in-string
"%" "%%"
(format " %s %s %s"
- (shell-command-to-string "mail-string")
- (shell-command-to-string "power-string")
- (shell-command-to-string "t1-string")))))
+ (shell-command-to-string "/home/bdunahu/.local/bin/mail-string 2>/dev/null")
+ (shell-command-to-string "/home/bdunahu/.local/bin/power-string 2>/dev/null")
+ (shell-command-to-string "/home/bdunahu/.local/bin/t1-string 2>/dev/null")))))
(defvar-local bd/external-mode-line
'(:eval (when new-mode-line