Browse Source

Slight improvements to the user experience

  * Display indexes when interactively switching workspaces

  * If `exwm-nw-get-name' isn't given an argument return the name of
    the current workspace.
tags/v0.2.0^0
Peter J. Jones 10 months ago
parent
commit
ada2cf7874
Signed by: Peter Jones <pjones@devalot.com> GPG Key ID: 9DAFAA8D01941E49
2 changed files with 20 additions and 9 deletions
  1. 7
    1
      CHANGES.md
  2. 13
    8
      exwm-nw.el

+ 7
- 1
CHANGES.md View File

@@ -1,7 +1,7 @@
Release Notes for `exwm-nw`
===========================

Version 0.2.0 (Not yet released)
Version 0.2.0 (January 27, 2019)
--------------------------------

* Rename `exwm-nw-set` to `exwm-nw-set-name` (same with `-get`).
@@ -12,6 +12,12 @@ Version 0.2.0 (Not yet released)
* Correctly activate new workspaces when using
`exwm-nw-find-workspace` from within EXWM's workspace switcher.

* `exwm-nw-get-name` can now return the name of the current
workspaces when no workspace is given.

* When prompting for a workspace to switch to, indexes are shown in
addition to names.

Version 0.1.0 (June 22, 2018)
-----------------------------


+ 13
- 8
exwm-nw.el View File

@@ -1,11 +1,11 @@
;;; exwm-nw.el --- Named workspaces for EXWM. -*- lexical-binding: t -*-

;; Copyright (C) 2018 Peter Jones <pjones@devalot.com>
;; Copyright (C) 2018-2019 Peter Jones <pjones@devalot.com>

;; Author: Peter Jones <pjones@devalot.com>
;; Homepage: https://github.com/pjones/exwm-nw
;; Package-Requires: ((emacs "25.1") (exwm "0.18"))
;; Version: 0.1.0
;; Version: 0.2.0
;;
;; This file is not part of GNU Emacs.

@@ -113,8 +113,8 @@ The alist is ordered so that recently visited workspaces come first."
exwm-workspace--list))
(if (and (exwm-workspace--workspace-p w)
(or keep-current (not (eq w current))))
(let ((name (exwm-nw-get-name w))
(pos (exwm-workspace--position w)))
(let* ((pos (exwm-workspace--position w))
(name (exwm-nw--format pos)))
(if (and name (not (assoc name names)))
(setq names (append names (list (cons name pos))))))))
names))
@@ -134,10 +134,15 @@ The alist is ordered so that recently visited workspaces come first."
(call-interactively 'exwm-workspace-switch))))
;; Public functions:
(defun exwm-nw-get-name (frame-or-index)
"Return the name of the workspace identified by FRAME-OR-INDEX."
(let ((ws (exwm-workspace--workspace-from-frame-or-index frame-or-index)))
(frame-parameter ws 'exwm-nw-name)))
;;;###autoload
(defun exwm-nw-get-name (&optional frame-or-index)
"Return the name of the workspace identified by FRAME-OR-INDEX.
If FRAME-OR-INDEX is not given or nil then return the name of the
current workspace."
(let* ((frame (or frame-or-index exwm-workspace--current))
(ws (exwm-workspace--workspace-from-frame-or-index frame))
(name (frame-parameter ws 'exwm-nw-name)))
(and name (substring-no-properties name))))

;;;###autoload
(defun exwm-nw-set-name (frame-or-index &optional name)

Loading…
Cancel
Save