From b8b2a499e1afe5cd138b98d1cc64d400c8b28d32 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Wed, 9 Sep 2020 11:26:21 +0100 Subject: feat(tazjin/emacs): Rename Quassel EXWM windows This gives Quassel buffers sensible titles containing the name of the network the buffer is currently displaying. Ideally it would show me the name of the Quassel Core connection, but this isn't exported from Quassel into the X window title. The regex captures both the channel and the network, but only the network is currently used for display - I may revisit that at some point. Change-Id: Ife4c06919d9e9c0114ff298e1443b2b27ce2f146 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1964 Tested-by: BuildkiteCI Reviewed-by: tazjin --- users/tazjin/emacs/config/desktop.el | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'users/tazjin') diff --git a/users/tazjin/emacs/config/desktop.el b/users/tazjin/emacs/config/desktop.el index f07e4fd45e..248da97eef 100644 --- a/users/tazjin/emacs/config/desktop.el +++ b/users/tazjin/emacs/config/desktop.el @@ -88,6 +88,20 @@ ;; stripped since most of my terminals are fish shells anyways. (format "Term<%s>" (s-trim-left (s-chop-prefix "fish" title)))) + ;; Quassel buffers + ;; + ;; These have a title format that looks like: + ;; "Quassel IRC - ##tvl (Freenode) — Quassel IRC" + (`("quassel" ,title) + (progn + (string-match + (rx "Quassel IRC - " + (group (one-or-more (any alnum "#"))) ;; <-- channel name + " (" (group (one-or-more (any ascii space))) ")" ;; <-- network name + " — Quassel IRC") + title) + (format "Quassel<%s>" (match-string 2 title)))) + ;; For any other application, a name is constructed from the ;; window's class and name. (`(,class ,title) (format "%s<%s>" class (s-truncate 12 title))))) -- cgit 1.4.1