From aacd40d6adbf9bfb510e40b7ddb93678e7cecbcd Mon Sep 17 00:00:00 2001 From: TCCQ Date: Wed, 9 Apr 2025 19:53:47 -0700 Subject: emacs to add single top header and move some (global) info there --- emacs/site-lisp/exwm-pref.el | 38 ++++++++++++++++---------------------- 1 file changed, 16 insertions(+), 22 deletions(-) (limited to 'emacs/site-lisp/exwm-pref.el') diff --git a/emacs/site-lisp/exwm-pref.el b/emacs/site-lisp/exwm-pref.el index f03711c..c6d51d1 100644 --- a/emacs/site-lisp/exwm-pref.el +++ b/emacs/site-lisp/exwm-pref.el @@ -27,29 +27,20 @@ (setq exwm-manage-force-tiling t) + (defun b3n-exwm-set-buffer-name () - (if (and exwm-title (string-match "\\`http[^ ]+" exwm-title)) - (let ((url (match-string 0 exwm-title))) - (setq-local buffer-file-name url) - (setq-local exwm-title (replace-regexp-in-string - (concat (regexp-quote url) " - ") - "" - exwm-title)) - (setq-local exwm-title (replace-regexp-in-string - " - Mozilla Firefox" - "" - exwm-title)))) - - (setq-local exwm-title - (concat - exwm-class-name - "<" - ;; (if (<= (length exwm-title) exwm-title-length) - exwm-title - ;; (concat (substring exwm-title 0 exwm-title-length) "…")) - ">")) - - (exwm-workspace-rename-buffer exwm-title)) + (if exwm-title + (let* ((shortened-title (replace-regexp-in-string + " - Mozilla Firefox" + "" + exwm-title)) + (class-and-title (concat + exwm-class-name + "<" + shortened-title + ">"))) + (setq-local exwm-title class-and-title) + (exwm-workspace-rename-buffer exwm-title)))) (add-hook 'exwm-update-class-hook 'b3n-exwm-set-buffer-name) (add-hook 'exwm-update-title-hook 'b3n-exwm-set-buffer-name) @@ -189,6 +180,9 @@ ;; (start-process-shell-command command nil command))) ;; browser ([?\s-e] . (lambda () + (interactive) + (start-process-shell-command "vimb" nil "vimb"))) + ([?\s-E] . (lambda () (interactive) (start-process-shell-command "firefox" nil "firefox"))) ;; ([?\M-e] . (lambda () -- cgit v1.2.3