From 869bcf3fc84994b0074e735b2204fd7a180dfd44 Mon Sep 17 00:00:00 2001 From: William Carroll Date: Sat, 3 Oct 2020 14:49:02 +0100 Subject: [PATCH] Define fn for outputting the current workspace's label This is a useful helper fn, and hopefully something I'll support in my mode line soon. --- emacs/.emacs.d/wpc/window-manager.el | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/emacs/.emacs.d/wpc/window-manager.el b/emacs/.emacs.d/wpc/window-manager.el index 605083402..cda66a296 100644 --- a/emacs/.emacs.d/wpc/window-manager.el +++ b/emacs/.emacs.d/wpc/window-manager.el @@ -369,6 +369,12 @@ predicate." (list-map #'window-manager--register-kbd)) (window-manager--alert "Registered workspace KBDs!"))) +(defun window-manager-current-workspace () + "Output the label of the currently active workspace." + (->> window-manager--workspaces + cycle-current + window-manager--named-workspace-label)) + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Startup Applications in `window-manager--named-workspaces' ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;