about summary refs log tree commit diff
path: root/emacs/.emacs.d/wpc/window-manager.el
diff options
context:
space:
mode:
authorWilliam Carroll <wpcarro@gmail.com>2020-10-03T13·49+0100
committerWilliam Carroll <wpcarro@gmail.com>2020-10-03T13·49+0100
commit869bcf3fc84994b0074e735b2204fd7a180dfd44 (patch)
treeaf1d3b7d7d4c20ea980a1ea9317340ed5e49f91a /emacs/.emacs.d/wpc/window-manager.el
parent8137eed73850b35b8e9f18ec2f1cbb586f3e0cc7 (diff)
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.
Diffstat (limited to 'emacs/.emacs.d/wpc/window-manager.el')
-rw-r--r--emacs/.emacs.d/wpc/window-manager.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/emacs/.emacs.d/wpc/window-manager.el b/emacs/.emacs.d/wpc/window-manager.el
index 6050834028e8..cda66a296492 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'
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;