summaryrefslogtreecommitdiff
path: root/common/.emacs.d/init.el
diff options
context:
space:
mode:
Diffstat (limited to 'common/.emacs.d/init.el')
-rw-r--r--common/.emacs.d/init.el49
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)