Control the telephony stack of your smartphone from inside Emacs via ofono and Bluetooth.
- Hangup calls & and dial phone-numbers.
- Answer incoming calls.
- Hooks for various actions.
tel:
Org-links- Supports multiple phones.
- Supports multiple HCI Bluetooth controllers.
demo.mp4
INFO: Please make sure you have both D-BUS and ofonod installed and running before following along.
You can install ephone.el through git:
git clone https://github.com/27justin/ephone.el ~/.emacs.d/site-lisp/ephone.el
Then add the path to your load-path
and (require)
the package.
(add-to-list 'load-path "~/.emacs.d/site-lisp/ephone.el")
(setq ephone-periodic-scan t)
(setq ephone-scan-interval "3 min")
(setq ephone-periodic-scan-break-after-found t)
(require 'ephone)
(ephone--attach-dbus-hooks)
NOTE: About
ephone-periodic-scan
/ephone-scan-interval
.ephone.el queries the ofono D-Bus once during
ephone--attach-dbus-hooks
, given this, ephone.el won’t properly attach to any device you connect **after** loading the plugin.To circumvent this, you can either manually run
M-x ephone/scan RET
after connecting your phone, or facilitate the given variables.When
ephone-periodic-scan
ist
, ephone.el sets up a timer running everyephone-scan-interval
(default 3 min), this timer will automatically callephone/scan
for you to make sure your phone keeps / gets connected to the Emacs hooks.Additionally you may also set
ephone-periodic-scan-break-after-found
tot
, with this ephone.el will also automatically remove it’s perodic-scan timer after attaching to one device.
After which you can re-evaluate your config, or restart Emacs.
ephone.el’s interactive functions are prefixed with ephone/.
Here an overview of said functions.
(ephone/dial "<number>")
(ephone/dial-last-number)
(ephone/hangup) ;; Also used to reject incoming calls.
(ephone/answer)
(ephone/scan) ;; Re-fetch & attach devices from ofono
Some other non-interactive functions you might want to use.
(ephone/get-phone-number) ;; Returns the Phone-number of the active call as a string,
;; or nil
ephone.el provides the following hooks
ephone-call-hook ;; Runs when a call is either started or received.
ephone-hangup-hook ;; Runs when a call is ended.
A prominent use-case may be clocking out of the current org-task and starting a capture buffer whenever a call is received, or started.
(add-to-list 'org-capture-templates ("p" "Call" entry
(file+headline "~/org/TASKS.org" "Calls")
"* %T %(ephone/get-phone-number)\n %?"
:clock-resume t :clock-in t))
(defun capture-received-call ()
(org-capture nil "p"))
(add-hook ephone-call-hook #'capture-received-call)
Another fairly useful feature are tel:
org-links, with similar semantics to the href
Attribute on HTML <a>
-tags
for those familiar.
Running C-c C-o
/ org-open-at-point
on these links will run ephone/dial
with the given number.