emacs 27 has an update to emacs’ tetris mode which makes the glyphs display larger on higher DPI screens.

This script will download that update from git.savannah.gnu.org and display tetris in a distraction free environment for the ultimate productivity.

If you symlink this script to etetris-vt100 and run that instead, you will get the animated and striking black and white terminal version.

ln -s etetris etetris-vt100

If you symlink this script to etetris-xterm and run that instead, you will get the vivid color terminal version.

ln -s etetris etetris-xterm

The script etetris

#!/bin/bash
sn="$(basename "$0")"

if test "$sn" = "etetris-xterm"; then
    nw=" -nw "
elif test "$sn" = "etetris-vt100"; then
    nw=" -nw "
    export TERM=vt100
else
    extra="(load \"/tmp/tetris-load.el\")"
fi

cat <<HEREDOC > /tmp/tetris-load.el
(defun str (thing)
  "Converts object or string to an unformatted string."
  (setq thing (format "%s" thing))
  (set-text-properties 0 (length thing) nil thing)
  thing)

(defun my-new-buffer-frame (&optional contents bufname)
  "Create a new frame with a new empty buffer."
  (interactive)
  (if (not bufname)
      (setq bufname "*untitled*"))
  (let ((buffer (generate-new-buffer bufname)))
    (set-buffer-major-mode buffer)
    ;; (display-buffer buffer '(display-buffer-pop-up-frame . nil))
    (display-buffer buffer '(display-buffer-same-window . nil))
    (with-current-buffer buffer
      (insert (str contents))
      (beginning-of-buffer))
    buffer))
(defalias 'new-buffer-from-string 'my-new-buffer-frame)

(defun buffer2string (buffer)
  (with-current-buffer buffer
    (save-restriction
      (widen)
      (buffer-substring-no-properties (point-min) (point-max))
      ;;(buffer-substring-no-properties buffer (point-min) (point-max))
      )))

(defun ecurl (url)
  (with-current-buffer (url-retrieve-synchronously url t t 5)
    (goto-char (point-min))
    (re-search-forward "^$")
    (delete-region (point) (point-min))
    (kill-line)
    (let ((result (buffer2string (current-buffer))))
      (kill-buffer)
      result)))

(defun load-tetris-update ()
  (with-current-buffer (new-buffer-from-string (ecurl "http://git.savannah.gnu.org/cgit/emacs.git/plain/lisp/play/gamegrid.el"))
    (eval-buffer (current-buffer))
    (kill-buffer)))

(load-tetris-update)
HEREDOC

# (execute-kbd-macro (kbd \"C-l\"))
emacs $nw -q --eval "(progn $extra(tool-bar-mode -1)(menu-bar-mode -1)(call-interactively 'tetris)(setq mode-line-format '())(message \"\"))"