diff options
| author | Simon Parri <simonparri@ganzeria.com> | 2025-10-29 09:11:24 -0500 |
|---|---|---|
| committer | Simon Parri <simonparri@ganzeria.com> | 2025-10-29 09:14:43 -0500 |
| commit | b547373d09421d652add881483211389e986eccc (patch) | |
| tree | 47b098a816dc5a5bc9afff5eeabb093eb733fb70 | |
| parent | 04c3db1d22651bf05b1ecbc8ad2f045813ce0801 (diff) | |
| download | dotfiles-b547373d09421d652add881483211389e986eccc.tar.gz dotfiles-b547373d09421d652add881483211389e986eccc.zip | |
Emacs: Add mode for interaction on mobile devices
| -rw-r--r-- | common/.emacs.d/init.el | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/common/.emacs.d/init.el b/common/.emacs.d/init.el index 11d3ab0..363ab01 100644 --- a/common/.emacs.d/init.el +++ b/common/.emacs.d/init.el @@ -3992,6 +3992,55 @@ instead." (setq winner-dont-bind-my-keys t)) (winner-mode)) +(progn ;; mobile-device-mode + (defun osk-toggle () + (interactive) + (call-process-shell-command + "qdbus org.onboard.Onboard /org/onboard/Onboard/Keyboard org.onboard.Onboard.Keyboard.ToggleVisible")) + + (defvar-keymap mobile-device-mode-map + "<XF86PowerOff> <XF86PowerOff>" 'osk-toggle + "<XF86PowerOff <XF86AudioRaiseVolume>" 'mobile-device-volume-mode + "<XF86PowerOff> <XF86AudioLowerVolume>" 'mobile-device-navigate-mode + "<XF86AudioLowerVolume> <XF86PowerOff>" 'suspend + + "<XF86Launch0>" 'networks + "<XF86Launch1>" 'notifications + "<XF86Launch2>" 'bluetooth + "S-<XF86Launch2>" 'mixer + "<XF86Launch3>" 'next-buffer + "<XF86Launch4>" 'exwm-run + "S-<XF86Launch4>" 'eshell + "<XF86Launch5>" 'switch-to-buffer + "S-<XF86Launch5>" 'kill-buffer-and-maybe-window + "<XF86Launch7>" 'previous-buffer + ) + + (defvar-keymap mobile-device-navigate-mode-map + "<XF86AudioLowerVolume>" 'next-line + "<XF86AudioRaiseVolume>" 'previous-line + "<XF86PowerOff>" 'mobile-device-navigate-mode) + + (defvar-keymap mobile-device-volume-mode-map + "<XF86AudioLowerVolume>" 'pulseaudio-sink-lower + "<XF86AudioRaiseVolume>" 'pulseaudio-sink-raise + "<XF86PowerOff>" 'mobile-device-volume-mode) + + (define-minor-mode mobile-device-mode + "Minor mode for tablet/phone UI." + :global t + :lighter "") + + (define-minor-mode mobile-device-navigate-mode + "Minor mode to navigate for tablet/phone UI." + :global t + :lighter " Navig") + + (define-minor-mode mobile-device-volume-mode + "Minor mode to change volume for tablet/phone UI." + :global t + :lighter " ChVol")) + (progn ;; term (defun spawn-term (&optional dir) (interactive) |
