reddit / emacs

Global Emacs keybinds through all the desktop not just Emacs

Thaodan · 2022-11-02 07:16
Hey, I've recently moved to Emacs for some tasks I used other applications for including Music-player/mpd control. I wonder has anyone managed to set these kinds that make you start these "apps" inside Emacs globally so you can activate them outside of Emacs? Like I use \`s-h h\` to activate \`helm-emms\` or \`s-h b\` to activate \`emms-browser\` and I would like to able to use these outside of Emacs.
a-concerned-mother · 2022-11-02 08:02
If you don't find a decent answer you could maybe use https://gitlab.com/interception/linux/tools to catch some emacs keybindings and check the current window
chewxy · 2022-11-02 10:56
Use exwm if you're on a linux. You can inherit your emacs keybindings. But within each individual application you might still need to change your keybindings
Thaodan · 2022-11-02 11:48
Really interesting however I don't want Emacs to be my because of it's single thread design (can Exvm look up?). The next is is the Exvm is X11 landlocked.
Vince_Vice · 2022-11-02 12:33
> can Exvm look up? Wdym? I think a regular technique is to start a second emacs alongside the one running EXMW that provides the server for emacsclient frames, but I am not on EXWM so IDK if its stable
knome · 2022-11-02 16:01
bash already uses a bunch of emacs keybindings, as well as anything using gnu readline, so a good number of REPLs do as well
CorysInTheHouse69 · 2022-11-02 16:12
I use vimium and a customized about:config to have my Firefox have identical emacs keybinds. I also have set my gtk keybind setting to emacs keybinds so all gtk apps take emacs keybinds for text manipulation
terminal_cope · 2022-11-02 18:31
Run emacs in daemon mode and map desktop keys to `emacsclient -c --eval (xxxx)` I think should work. But key sequences wouldn't work. You need one binding per action.
albertsj1 · 2022-11-03 12:47
You didn't mention what OS you use. If you use MacOS, you can use [skhd](https://github.com/koekeishiya/skhd). It's a hotkey daemon and it supports \`modes\`, which allow you to specify a keybinding, such as \`s-h\`, to switch to a special mode of other keybindings, that you can then use to trigger things. [Here is a complex but robust example](https://github.com/nikhgupta/dotfiles/blob/osx/config/skhd/skhdrc) of what can be done with skhd and modes.