From 7a2324a826ae339d5d416a178d72217d8e4a5dce Mon Sep 17 00:00:00 2001 From: Aleksandr Lebedev Date: Thu, 30 Jan 2025 22:38:19 +0100 Subject: [PATCH] Added some code for android gui version --- .gitignore | 12 ++++++++++-- config.org | 13 ++++++++++++- early-init.el | 7 +++++++ init.el | 8 ++++++++ 4 files changed, 37 insertions(+), 3 deletions(-) create mode 100644 early-init.el diff --git a/.gitignore b/.gitignore index c2b425d..6bb1728 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,10 @@ -eln-cache -config.el +#Ignore all +* +#Allow theese (don't forget to put '!') +!config.org +!early-init.el +!package.nix +!flake.nix +!init.el +!.gitignore +!flake.lock diff --git a/config.org b/config.org index e1b3947..59fc5f1 100644 --- a/config.org +++ b/config.org @@ -65,6 +65,7 @@ - [[#tldr][TLDR]] - [[#transparency][Transparency]] - [[#which-key][WHICH-KEY]] +- [[#emacs-on-android][Emacs on Android]] * IMPORTANT PROGRAMS TO LOAD FIRST ** Evil Mode @@ -549,6 +550,8 @@ Install luacheck from your Linux distro’s repositories for flycheck to work co * Fonts Defining the various fonts that Emacs will use. #+begin_src emacs-lisp + +(unless (string-equal system-type "android") ;; I have no idea, how to make GUI emacs see the fonts. (set-face-attribute 'default nil :font "JetBrains Mono" :height 110 @@ -575,7 +578,7 @@ Defining the various fonts that Emacs will use. (add-to-list 'default-frame-alist '(font . "JetBrains Mono-11")) ;; Uncomment the following line if line spacing needs adjusting. -(setq-default line-spacing 0.12) +(setq-default line-spacing 0.12)) #+end_src ** Zooming In/Out @@ -1143,3 +1146,11 @@ With Emacs version 29, true transparency has been added. which-key-allow-imprecise-window-fit nil which-key-separator " → " )) #+end_src + +* Emacs on Android +#+begin_src emacs-lisp +(when (string-equal system-type "android") + (setq touch-screen-keyboard-function t) + (setq touch-screen-display-keyboard t) +) +#+end_src diff --git a/early-init.el b/early-init.el new file mode 100644 index 0000000..e5d2ac0 --- /dev/null +++ b/early-init.el @@ -0,0 +1,7 @@ +;;; -*- lexical-binding: t; -*- +(when (string-equal system-type "android") + ;; Add Termux binaries to PATH environment + (let ((termuxpath "/data/data/com.termux/files/usr/bin")) + (setenv "PATH" (concat (getenv "PATH") ":" termuxpath)) + (setq exec-path (append exec-path (list termuxpath))))) + diff --git a/init.el b/init.el index 41ab4c1..15b3d86 100644 --- a/init.el +++ b/init.el @@ -1,4 +1,12 @@ ;;; -*- lexical-binding: t; -*- +(require 'package) +(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t) +;; Comment/uncomment this line to enable MELPA Stable if desired. +;; See `package-archive-priorities` and `package-pinned-packages`. +;; Most users will not need or want to do this. +;; (add-to-list 'package-archives +;; '("melpa-stable" . "https://stable.melpa.org/packages/") t) +(package-initialize) (org-babel-load-file (expand-file-name "config.org"