0

I'm trying to write elisp functions to work with exwm to switch to the next or previous workspaces and I came up with the following. They work as required with M-x, but when binding to a key, they don't work. Am I doing something wrong?

(defun exwm-workspace-switch-left ()
  (interactive)
  (let* ((ws (exwm-current-workspace))
         (new-ws 
          (if (= ws 0)
              (- (length exwm-workspace--list) 1)
            (- ws 1))))
    (exwm-workspace-switch new-ws)))

(defun exwm-workspace-switch-right ()
  (interactive)
  (let* ((ws (exwm-current-workspace))
         (new-ws 
          (if (>= (+ ws 1) (length exwm-workspace--list))
              0
            (+ ws 1))))
    (exwm-workspace-switch new-ws)))

(setq exwm-input-global-keys
`(  (,(kbd "S-M-<left>") . exwm-workspace-switch-left)
    (,(kbd "S-M-<right>") . exwm-workspace-switch-right)))


0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.