2

I'm not sure how to open more than one Emacs frame in a given workspace; ideally I would have one frame in each of my two monitors. Presently, my issue is that I'm stuck with only one frame in each workspace, and all lie in the same monitor. Here are the important parts of my config:

(require 'exwm)
(require 'exwm-config)

(setq exwm-workspace-number 4)

(require 'exwm-randr)
(setq exwm-randr-workspace-output-plist '(0 "VGA1"))
(add-hook 'exwm-randr-screen-change-hook
  (lambda ()
    (start-process-shell-command
     "xrandr" nil "xrandr --output VGA1 --left-of LVDS1 --auto")))
(exwm-randr-enable)

[...]

;; Global keybindings can be defined with `exwm-input-global-keys'.
;; Here are a few examples:
(setq exwm-input-global-keys
 `(
  ;; Bind "s-r" to exit char-mode and fullscreen mode.
    ([?\s-r] . exwm-reset)
  ;; Bind "s-w" to switch workspace interactively.
    ([?\s-w] . exwm-workspace-switch)
  ;; Bind "s-0" to "s-9" to switch to a workspace by its index.
    ,@(mapcar (lambda (i)
            `(,(kbd (format "s-%d" i)) .
              (lambda ()
                (interactive)
                (exwm-workspace-switch-create ,i))))
          (number-sequence 0 9))
;; Bind "s-&" to launch applications ('M-&' also works if the output
;; buffer does not bother you).
([?\s-&] . (lambda (command)
             (interactive (list (read-shell-command "$ ")))
             (start-process-shell-command command nil command)))
;; Bind "s-<f2>" to "slock", a simpl0e X display locker.
([s-f2] . (lambda ()
            (interactive)
            (start-process "" nil "/usr/bin/slock")))))

;; To add a key binding only available in line-mode, simply define it in
;; `exwm-mode-map'.  The following example shortens 'C-c q' to 'C-q'.
(define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)

(setq exwm-input-simulation-keys
 '(
;; movement
([?\C-b] . [left])
))

;; Do not forget to enable EXWM. It will start by itself when things are
;; ready.  You can put it _anywhere_ in your configuration.
(exwm-enable)

Another issue is that the exwm-input-global-keys I've set don't seem to work; if I try s-r, then the minibuffer simply tells me "s-r is undefined". I'd appreciate any suggestions. EDIT: I think I figured out the global-key thing. Still stuck on the monitor issue though.

1

Answered my own question. In case anyone might encounter this issue in the future, here's how I fixed it:

(require 'exwm-randr)
(setq exwm-randr-workspace-output-plist
  '(0 "HDMI-2" 1 "eDP-1"))
(add-hook 'exwm-randr-screen-change-hook
      (lambda ()
        (start-process-shell-command
         "xrandr" nil "xrandr --output HDMI-2 --output eDP-1 --auto")))
(exwm-randr-enable)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.