about summary refs log tree commit diff
path: root/users/tazjin/emacs/config/desktop.el
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2020-09-09T10·26+0100
committertazjin <mail@tazj.in>2020-09-09T10·56+0000
commitb8b2a499e1afe5cd138b98d1cc64d400c8b28d32 (patch)
tree959ac10a2d9582a1e01a357dc0aaa654705acb6e /users/tazjin/emacs/config/desktop.el
parent7a242c04d8e8bd94a30afaac95010fd6f266afeb (diff)
feat(tazjin/emacs): Rename Quassel EXWM windows r/1774
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 <mail@tazj.in>
Diffstat (limited to 'users/tazjin/emacs/config/desktop.el')
-rw-r--r--users/tazjin/emacs/config/desktop.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/users/tazjin/emacs/config/desktop.el b/users/tazjin/emacs/config/desktop.el
index f07e4fd45ec3..248da97eefcb 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)))))