← Back to context

Comment by timonoko

3 days ago

Ultimate .emacs on termux, note python-hook

  (menu-bar-mode -1)
  (setq inhibit-splash-screen t)
  (setq inhibit-startup-echo-area-message t)
  (global-set-key "å" 'hippie-expand)
  (global-set-key "∆" 'toggle-truncate-lines)
  (global-set-key (kbd "<f12>") 'toggle-truncate-lines)
  (xterm-mouse-mode 1)
  (global-set-key (kbd "<mouse-5>") 'scroll-up-command)
  (global-set-key (kbd "<mouse-4>") 'scroll-down-command) ;
  (global-set-key (kbd "<wheel-up>") 'scroll-up-command)
  (global-set-key (kbd "<wheel-down>") 'scroll-down-command) ;
  (setq case-fold-search t)
  (setq-default truncate-lines t)
  (setq sort-fold-case t)
  (autoload 'scad-mode "scad-mode" "A major mode for editing OpenSCAD code." t)
  (add-to-list 'auto-mode-alist '("\\.scad$" . scad-mode))
  (require 'scad-preview)
  (global-set-key (kbd "Å") 'dabbrev-expand)
  
  (add-hook 'python-mode-hook 'whitespace-mode)
  (setq whitespace-line-column 128)
  (custom-set-faces
   '(default ((t (:background "#000000" :foreground "#ffffff"))))
   '(whitespace-space ((t (:background "black" :foreground "blue"))))
   '(whitespace-tab ((t (:background "black" :foreground "blue"))))
   '(whitespace-newline ((t (:background "black" :foreground "blue"))))
   '(whitespace-empty ((t (:background "black" :foreground "grey50")))))

What keyboard are you using? one where å Å ∆ F12 are easily accessible?

Is there a good interface to (GUI?) openscad from termux?

  • Å is in Finnish Keyboards, but totally useless. F12 is easily accessible in Hacker's Keyboard. ∆ is in Gboard.

    There no gui, you use openscad to generate STL and view that in Android STL-viewer. You can automatize it so that it is almost like the real thing.

      file_to_watch=$1
      last_modified=$(stat -c %Y "$file_to_watch")
      while true; do
          current_modified=$(stat -c %Y "$file_to_watch")
          if [ "$last_modified" != "$current_modified" ]; then
              openscad $1 -o $1.stl
              last_modified="$current_modified"
          fi
          sleep 1  # Check every second
      done