There are three modes* in EXWM.
I. Sending all the keys to the apps except the global bindings (for e.g. this is a global (exwm-input-set-key (kbd "s-c") #'list-processes). EXWM calls this char-mode
II. Sending all the keys to the apps with some simulations. EXWM calls this line-mode. You can define simulations like.
I do not think there's a built-in way to do this, but you could add the code below to your init-file.
(defvar exwm-workspace-previous-index nil "The previous active workspace index.")
(defun exwm-workspace--current-to-previous-index (_x)
(setq exwm-workspace-previous-index exwm-workspace-current-index))
(advice-add 'exwm-workspace-switch :before #'exwm-...
You can use exwm-manage-finish-hook to perform functions when a window has loaded. Combine that with exwm-class-name and exwm-workspace-move-window and you could do something like this:
(require 'subr-x) ;; Because of when-let
'(("Firefox" . 2)
("Thunderbird" . 3))
"An alist of window classes and which ...
Answered my own question. In case anyone might encounter this issue in the future, here's how I fixed it:
'(0 "HDMI-2" 1 "eDP-1"))
"xrandr" nil "xrandr --output HDMI-2 --output eDP-1 --auto"))...
The reason your emacs bindings don't work in firefox is because they are not bound through EXWM. EXWM is the medium emacs uses to communicate to x-windows so you need to set the bindings through it. EXWM by default enables only a subset of your emacs bindings are available in x windows (and only in line-mode).
Like in Emacs, there are two kinds of bindings ...
The best solution is simply to hit C-c C-k (exwm-input-release-keyboard) which puts the X-window containing the inner emacs into char-mode. Then, when that window has focus, almost all keyboard input, including C-x C-c is passed to the inner emacs.
Hit s-r (exwm-reset) to get the window back to normal line-mode.
The problem is that any commands you execute such as C-x C-c will be captured by the Emacs instance running EXWM.
The first thing to try - which did not work for OP - is to execute M-x exwm-input-grab-keyboard with the secondary Emacs window selected. This will set the window to char mode, and send the keys you type directly to that window. So C-x C-c will ...
So it seems the answer was already in the docs on github.
We regard fullscreen as a third layout mode here. An X window in either tiling or floating mode can be made fullscreen explicitly by invoking C-c C-f.
I look for the existence of a window manager using wmctrl -m. If that command outputs anything on stderr I assume there is no window manager and run the EXWM startup.
(when (get-buffer "*window-manager*")
(when (get-buffer "*window-manager-error*")
Try this instead:
(defun my-new-exwm-launch (command)
(start-process-shell-command command nil command))
(exwm-input-set-key (kbd "s-g") (lambda () (interactive) (my-new-exwm-launch "gkamus")))
Based upon a comment from the O.P., here is a different example using a previous answer written by @sds at https://emacs.stackexchange.com/a/...
You need to create /usr/share/xsessions/emacs.desktop with the following content:
Comment=Emacs Window Manager
After that you should be able to select it from that menu.
I'm reading the guide and seems it's also possible to prefix all the usual shortcuts with C-c C-q (exwm-input-send-next-key) without switching to char-mode. So instead of C-a/C-c/C-v use C-c-q-a/C-c-q-c/C-c-q-v.