Emacs Application Framework (EAF) is an application framework that extend GNU Emacs to an entire new universe of powerful GUI PyQt applications.
EAF is also super extensible, developers can develop any PyQt program, and integrate it into Emacs through EAF.
This framework mainly implements three functions:
|Image Viewer||Video Player|
|File Sender||File Receiver|
|Air Share||Org Previewer|
sudo pip3 install dbus-python pymupdf grip qrcode python-xlib pyqt5 pyqtwebengine
git clone https://github.com/lxqt/qtermwidget.git --depth=1 mkdir bulid && cd build cmake .. -DQTERMWIDGET_BUILD_PYTHON_BINDING=ON -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_LIBDIR=/usr make sudo make install
use-package sample configuration
(use-package eaf :load-path "~/.emacs.d/site-lisp/emacs-application-framework" :custom (eaf-find-alternate-file-in-dired t) :config (eaf-bind-key scroll_up "RET" eaf-pdfviewer-keybinding) (eaf-bind-key scroll_down_page "DEL" eaf-pdfviewer-keybinding) (eaf-bind-key scroll_up "C-n" eaf-pdfviewer-keybinding) (eaf-bind-key scroll_down "C-p" eaf-pdfviewer-keybinding) (eaf-bind-key take_photo "p" eaf-camera-keybinding) (defun eaf-open-google () "Open Google using EAF." (interactive) (eaf-open-browser "https://www.google.com")))
|Debian Package||Package Repo||Use for|
|dbus-python||pip3||DBus IPC for python and elisp|
|pymupdf||pip3||Render engine required for PDF Viewer|
|grip||pip3||Markdown render server for Markdown Previewer|
|qrcode||pip3||Render local file QR code|
|python-xlib||pip3||Stick app window into emacs frame|
|pyqt5||pip3||GUI library required for application development|
|pyqtwebengine||pip3||QtWebEngine for browser application|
|qtermwidget-git||source code compile||QTermWidget is terminal emulator for PyQt5|
If you prefer to run linux in a docker, you can read Run EAF with docker
There are mainly three obstacles:
|Browser||Type 'eaf-browser' RET https://www.google.com|
|PDF Viewer||Type 'eaf-open' RET pdf filepath|
|Video Player||Type 'eaf-open' RET video filepath|
|Image Viewer||Type 'eaf-open' RET image filepath|
|Markdown previewer||Type 'eaf-open' RET markdown filepath|
|Org file previewer||Type 'eaf-open' RET org filepath|
|File Sender||Type 'eaf-file-sender-qrcode'|
|Or use 'eaf-file-sender-qrcode-in-dired'|
|File Receiver||Type 'eaf-file-receiver-qrcode'|
Please check Key binding to check keybinding of application.
NOTE: EAF use DBus' session bus, it must running in general user. Please don't run EAF with root user, root user just can access DBus's system bus.
There are default keybindings for each EAF application provided by us. If you want to see them all, execute
C-h m within an EAF buffer.
You can easily customize EAF keybindings, find the corresponding keybinding variable, and add the something like the following to
(eaf-bind-key scroll_up "C-n" eaf-pdfviewer-keybinding) (eaf-bind-key scroll_down "C-p" eaf-pdfviewer-keybinding) (eaf-bind-key take_photo "p" eaf-camera-keybinding)
Currently available keybinding variables are
There are certain variables will be shared across Emacs Lisp and Python. You can easily configure then with
Check the full list of configurable variables with
C-h v eaf-var-list .
The default directory to store images taken by EAF Camera is
~/Downloads . To modify it, add the something like the following to
(eaf-setq eaf-camera-save-path "new/path/")
If you can't access most awesome internet services like me, you perhaps need proxy settings like below:
(setq eaf-http-proxy-host "127.0.0.1") (setq eaf-http-proxy-port "1080")
Then EAF browser is working! ;)
If you use markdown previewer, you need the access to a Personal access token , fill something in "Token description" and click button "Generate token" to get your personal token, then set token with code:
(setq eaf-grip-token "yourtokencode")
Otherwise, github will popup "times limit" error because so many people use grip. ;)
EAF use X11 XReparent technology to stick Qt5 window on Emacs buffer area, Wayland not support XReparent.
I recommend you use KDE, it's stable enough and support X11 XReparent technology.
If you got "undefined symbol" error after start EAF, and you use Arch Linux, yes, it's a bug of Arch.
You need use pip install all dependences after you upgrade your Arch system, then undefine symbol error will fix.
If you have any problem with EAF, please use command "emacs -Q" to start Emacs without any customizations.
Then re-test your workflow. If "emacs -Q" works fine, it's must be something wrong with your emacs config file.
If the problem persists, please report bug here .
Do you want to make Emacs a real operating system?
Do you want to live in emacs more comfortably?
Want to create unparalleled plugins to extend emacs?
如果我的作品让你的生活充满快乐, 欢迎请我喝瓶啤酒, 哈哈哈哈