diff options
Diffstat (limited to '.exwm')
-rw-r--r-- | .exwm | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -27,12 +27,19 @@ (call-process-shell-command "setxkbmap -option ctrl:nocaps") +(defun truncate-exwm-title (s) + (if (<= (string-width s) 49) + s + (truncate-exwm-title (substring s 0 -1)))) + (defun exwm-rename-buffer () (interactive) (exwm-workspace-rename-buffer (concat exwm-class-name ":" - (if (<= (length exwm-title) 50) exwm-title - (concat (substring exwm-title 0 49) "..."))))) + (if (or (stringp exwm-title) + (<= (string-width exwm-title) 50)) + exwm-title + (concat (truncate-exwm-title exwm-title) "…"))))) (add-hook 'exwm-update-class-hook 'exwm-rename-buffer) (add-hook 'exwm-update-title-hook 'exwm-rename-buffer) |