about summary refs log tree commit diff
path: root/exwm-config.el
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-07-21T04·48+0800
committerChris Feng <chris.w.feng@gmail.com>2016-07-21T04·48+0800
commit0c114d97b78f806ebe2904c8f55f573fd7c879e7 (patch)
treec940a76366dceec1c44f6561c323e548b2b77379 /exwm-config.el
parentf48b8eafb0b8f8afab0d42459a29f605cf452daa (diff)
Fix workspace creation and deletion
* exwm-workspace.el (exwm-workspace-switch)
(exwm-workspace-switch-create): Move support for creating missing
workspaces from the former to the latter..
(exwm-workspace-switch-create-limit): New variable limiting the number
of new workspaces allowed to create each time.

* exwm-workspace.el (exwm-workspace--prompt-add)
(exwm-workspace--prompt-delete): New commands for adding and deleting
workspaces from the `read-from-minibuffer' prompt.
(exwm-workspace--prompt-add-allowed)
(exwm-workspace--prompt-delete-allowed): New variables telling whether
the above two commands are allowed to run.
(exwm-workspace--switch-map): Change "+" / "-" to use the new commands.
* exwm-workspace.el (exwm-workspace-switch, exwm-workspace-swap)
(exwm-workspace-move-window): Use this new feature.

* exwm-workspace.el (exwm-workspace-add, exwm-workspace-delete): Since
they are not used by the keymap any more, drop the use of idle timer.

* exwm-workspace.el (exwm-workspace--create-silently): New variable
indicating whether new workspaces should be created in the background.
(exwm-workspace--add-frame-as-workspace): Support creating new
workspaces in the background.

* exwm-workspace.el (exwm-workspace--on-ConfigureNotify):
Update workareas if it's not up to date.

* exwm-randr.el (exwm-randr--refresh): Raise the standalone minibuffer
when refreshed.

* exwm-config.el (exwm-config-default): Add `exwm-workspace-number' and
`exwm-workspace-switch-create'.
Diffstat (limited to 'exwm-config.el')
-rw-r--r--exwm-config.el6
1 files changed, 5 insertions, 1 deletions
diff --git a/exwm-config.el b/exwm-config.el
index e1e5010d3d0d..8c54607006d7 100644
--- a/exwm-config.el
+++ b/exwm-config.el
@@ -30,6 +30,8 @@
 
 (defun exwm-config-default ()
   "Default configuration of EXWM."
+  ;; Set the initial workspace number.
+  (setq exwm-workspace-number 4)
   ;; Make class name the buffer name
   (add-hook 'exwm-update-class-hook
             (lambda ()
@@ -41,7 +43,9 @@
   ;; 's-N': Switch to certain workspace
   (dotimes (i 10)
     (exwm-input-set-key (kbd (format "s-%d" i))
-                        `(lambda () (interactive) (exwm-workspace-switch ,i))))
+                        `(lambda ()
+                           (interactive)
+                           (exwm-workspace-switch-create ,i))))
   ;; 's-&': Launch application
   (exwm-input-set-key (kbd "s-&")
                       (lambda (command)