Removed android stuff

This commit is contained in:
Aleksandr Lebedev 2025-11-11 00:49:48 +01:00
parent 47b63df236
commit 36116ff953

View file

@ -98,11 +98,6 @@ Copies to both kill ring and system clipboard
(and (eq system-type 'gnu/linux) (and (eq system-type 'gnu/linux)
(file-exists-p "/proc/sys/fs/binfmt_misc/WSLInterop"))) (file-exists-p "/proc/sys/fs/binfmt_misc/WSLInterop")))
#+end_src #+end_src
** Is Android
#+begin_src emacs-lisp
(defun kylekrein/is-android ()
(string-equal system-type "android"))
#+end_src
** Notifications ** Notifications
*** Alert package *** Alert package
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -110,38 +105,6 @@ Copies to both kill ring and system clipboard
:ensure t :ensure t
) )
#+end_src #+end_src
*** Android notifications
Found the code [[https://www.reddit.com/r/emacs/comments/18xvtns/emacs_notifications_on_linux_and_android/][here]]
#+begin_src emacs-lisp
(require 'alert)
(defun alert-android-notifications-notify (info)
(unless (kylekrein/is-android)
(error "Android notifications are only supported on Android systems"))
"Send INFO using android-notifications-notify."
(let ((title (or (plist-get info :title) "Org Alert Reminder"))
(body (or (plist-get info :message) ""))
(urgency (let ((severity (plist-get info :severity)))
(cond ((eq severity 'urgent) 'critical)
((eq severity 'high) 'critical)
((eq severity 'moderate) 'normal)
((eq severity 'low) 'low)
((eq severity 'trivial) 'low)
(t 'normal))))
(icon (or (plist-get info :icon) alert-default-icon)))
(android-notifications-notify
:title title
:body body
:urgency urgency
:icon icon
)))
(alert-define-style 'android-notifications :title "Android Notifications"
:notifier #'alert-android-notifications-notify
)
#+end_src
*** Windows Notifications *** Windows Notifications
Using [[https://github.com/gkowzan/alert-toast][Alert toast]] Using [[https://github.com/gkowzan/alert-toast][Alert toast]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -151,14 +114,14 @@ Using [[https://github.com/gkowzan/alert-toast][Alert toast]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq alert-default-style (setq alert-default-style
(cond (cond
((kylekrein/is-android) 'android-notifications)
((kylekrein/detect-wsl) 'toast) ((kylekrein/detect-wsl) 'toast)
(t 'libnotify))) (t 'libnotify)))
#+end_src #+end_src
* Backup files (tilda files) * Backup files (tilda files)
By default, Emacs creates automatic backups of files in their original directories, such “file.el” and the backup “file.el~”. This leads to a lot of clutter, so lets tell Emacs to put all backups that it creates in the ~.emacs.d~ directory. By default, Emacs creates automatic backups of files in their original directories, such “file.el” and the backup “file.el~”. This leads to a lot of clutter, so lets tell Emacs to put all backups that it creates in the ~.cache/emacs~ directory.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(setq backup-directory-alist '((".*" . "~/.emacs.d/tildafiles"))) (make-directory "~/.cache/emacs/tildafiles")
(setq backup-directory-alist '((".*" . "~/.cache/emacs/tildafiles")))
#+end_src #+end_src
* Diminish * Diminish
This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add :diminish to any use-package block to hide that particular mode in the modeline. This package implements hiding or abbreviation of the modeline displays (lighters) of minor-modes. With this package installed, you can add :diminish to any use-package block to hide that particular mode in the modeline.
@ -252,14 +215,6 @@ The following settings are simple modes that are enabled (or disabled) so that E
(save-place-mode t) ;; Restore cursor place in file (save-place-mode t) ;; Restore cursor place in file
#+end_src #+end_src
** Battery info
#+begin_src emacs-lisp
(unless (or
(equal "Battery status not available" (battery))
(equal "Power N/A, battery Charging (N/A% load, remaining time N/A)" (battery))
(equal "Power N/A, battery Discharging (N/A% load, remaining time N/A)" (battery)))
(display-battery-mode 1))
#+end_src
* Epub support (Reader in Emacs) * Epub support (Reader in Emacs)
[[https://depp.brause.cc/nov.el/][Nov.el]] is recommended by [[https://www.masteringemacs.org/book][Author of Mastering Emacs book]] [[https://depp.brause.cc/nov.el/][Nov.el]] is recommended by [[https://www.masteringemacs.org/book][Author of Mastering Emacs book]]
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -594,18 +549,15 @@ Eshell is an Emacs 'shell' that is written in Elisp.
Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets the shell to be used in M-x shell, M-x term, M-x ansi-term and M-x vterm. By default, the shell is set to 'fish' but could change it to 'bash' or 'zsh' if you prefer. Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets the shell to be used in M-x shell, M-x term, M-x ansi-term and M-x vterm. By default, the shell is set to 'fish' but could change it to 'bash' or 'zsh' if you prefer.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless (kylekrein/is-android) ;;Fails to compile (use-package vterm
(use-package vterm
:ensure t :ensure t
;;:config )
))
#+end_src #+end_src
** Vterm-Toggle ** Vterm-Toggle
[[https://github.com/jixiuf/vterm-toggle][vterm-toggle]] toggles between the vterm buffer and whatever buffer you are editing. [[https://github.com/jixiuf/vterm-toggle][vterm-toggle]] toggles between the vterm buffer and whatever buffer you are editing.
#+begin_src emacs-lisp #+begin_src emacs-lisp
(unless (kylekrein/is-android)
(use-package vterm-toggle (use-package vterm-toggle
:ensure t :ensure t
:after vterm :after vterm
@ -624,7 +576,7 @@ Vterm is a terminal emulator within Emacs. The 'shell-file-name' setting sets t
;;(direction . bottom) ;;(direction . bottom)
;;(dedicated . t) ;dedicated is supported in emacs27 ;;(dedicated . t) ;dedicated is supported in emacs27
(reusable-frames . visible) (reusable-frames . visible)
(window-height . 0.3))))) (window-height . 0.3))))
#+end_src #+end_src
* CMake Projects * CMake Projects
#+begin_src emacs-lisp #+begin_src emacs-lisp
@ -740,21 +692,6 @@ Function to enable it for project
* Language support * Language support
Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM, AWK, C, C++, Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, M4, Makefiles, Metafont, Modula2, Object Pascal, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, SQL, Tcl, Verilog, and VHDL. Other languages will require you to install additional modes. Emacs has built-in programming language modes for Lisp, Scheme, DSSSL, Ada, ASM, AWK, C, C++, Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, M4, Makefiles, Metafont, Modula2, Object Pascal, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, SQL, Tcl, Verilog, and VHDL. Other languages will require you to install additional modes.
** Nix ** Nix
#+begin_src emacs-lisp
(use-package nix-ts-mode
:ensure t
:mode "\\.nix\\'"
:hook
(nix-ts-mode . lsp-deferred) ;; So that envrc mode will work
:custom
(lsp-disabled-clients '((nix-ts-mode . nix-nil))) ;; Disable nil so that nixd will be used as lsp-server
:config
(setq lsp-nix-nixd-server-path "nixd"
lsp-nix-nixd-formatting-command [ "alejandra" ]
lsp-nix-nixd-nixpkgs-expr "import <nixpkgs> { }"
lsp-nix-nixd-nixos-options-expr "(builtins.getFlake \"github:kylekrein/nixos-config\".nixosConfigurations.kylekrein-homepc.options"
lsp-nix-nixd-home-manager-options-expr "(builtins.getFlake \"github:kylekrein/nixos-config\".nixosConfigurations.kylekrein-homepc.options.home-manager.users.type.getSubOptions []"))
#+end_src
** GLSL ** GLSL
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package glsl-mode (use-package glsl-mode
@ -1308,26 +1245,6 @@ With Emacs version 29, true transparency has been added.
which-key-allow-imprecise-window-fit nil which-key-allow-imprecise-window-fit nil
which-key-separator " → " )) which-key-separator " → " ))
#+end_src #+end_src
* Emacs on Android
** Fonts
All fonts on Android must be in *~/fonts* directory
** Settings
#+begin_src emacs-lisp
(when (kylekrein/is-android)
;;Write all android settings here
(setq touch-screen-keyboard-function t)
(setq touch-screen-display-keyboard t)
(menu-bar-mode 1) ;; Enable the menu bar
(scroll-bar-mode 1) ;; Enable the scroll bar
(tool-bar-mode 1) ;;Enable the tool bar
(setq use-file-dialog t) ;; file dialog
(setq use-dialog-box t) ;; dialog box
(setq pop-up-windows t) ;; popup windows
(server-start)
)
#+end_src
* Emacs on WSL * Emacs on WSL
** Clipboard fix ** Clipboard fix
Found the fix [[https://www.lukas-barth.net/blog/emacs-wsl-copy-clipboard/][here]] Found the fix [[https://www.lukas-barth.net/blog/emacs-wsl-copy-clipboard/][here]]