1. 21
  1. 6

    That rocks!

    TTY has just enough, thus is super-light!

    I did a script to preview the color themes: https://www.reddit.com/r/commandline/comments/5j1ir7/script_to_set_custom_theme_in_tty_with_an_preview/

    I use the font and colour setup in my .profile, with case "$(tty)" in ( /dev/tty* ) ... ;; esac so that I can customize every tty I log into, regardless if at home or at the university (no root needed, fonts embedded on dotfiles).

    I did not know about ralt as a compose key! That will make TTY a viable option again, great!

    You may also enjoy this thread about using TTY only: https://nixers.net/showthread.php?tid=1669

    I used to switch between TTY for everyhing and start X when I wanted to see an image. With a few scripts, you can reduce the amount of times you need to start X.

    I am making this wikipedia to plain text script. [EDIT] see below.

    1. 3

      For convenience and longevity (if I move it on my git repo, dead link!), a version of doc-wiki without relying on iomenu:

      # search for a wikipedia article and display it in a pager
      E="$(printf '\033')"
      # search for a title
      wget -qO- "$API&list=search&srsearch=$*" |
      awk -v RS='"title": *"' 'NR > 1 { gsub(/".*/, ""); print; }' |
      # choose the first
      sed 1q |
      # download the raw wiki text
      xargs -I % wget -qO- "$WIKI/%?action=raw" |
      # format and display the page
      sed -r '
      	# bold
      	s/'"'''"'([^'"'"']*)'"'''"'/{\1}/g             # '''text'''
      	# wiki links
      	s/\[\[[^]|]*\|/[/g                             # [[*|
      	s/\{\{[^}|]*\|/[/g                             # {{*|
      	s/\[\[/[/g;  s/\]\]/]/g                        # [[     ]]
      	s/\{\{/[/g;  s/\}\}/]/g                        # {{     }}
      	# bullet lists
      	s/^(\*\**) */\n\1 /                            # * Text
      	# strip html entities
      	s/<[^>]*\/ *>//g                               # <tag />
      	s/<!--[^>]*-->//g                              # <!-- comment -->
      	s/<[^>]*>[^<]*<\/[^>]*>//g                     # <tag> * </tag>
      	s/&[^;]*;/ /g                                  # &escaped;
      ' | fold -w 72 -s | sed -r '
      	# paragraphs
      	/^[^=;]/ s/^/   /
      	# heading
      	s/^== *([^=].*) *==$/\n{\1}\n/g                # == Heading ==
      	s/^==(=*) *(.*[^=]) *(=*)==$/\n{\1 \2 \3}\n/g
      	# subheading
      	s/^; *(.*)/\n   {\1}\n/g                       # === Subheading ===
      	# underlined
      	s/\[/'$E[4m'/g                                 # [ * ]
      	# bold
      	s/\{/'$E[1m'/g                                 # { * }
      ' | sed '
      	# double empty lines
      	N; s/^\n$//; P; D
      ' | less -R
    2. 3

      Reading the splat.sh script they used to install Arch on their Chromebook reminded me once again that Arch Linux ARM distributes its OS downloads over HTTP.

      Don’t worry though, the script helpfully verifies the download by comparing the md5sum against one downloaded…over HTTP.

      1. 1

        Are the packages themselves signed using PGP?

        1. 2

          Looks like the answer is yes and no. Pacman is apparently able to do PGP package checks but the default is:

          SigLevel = Optional TrustedOnly

          which translates to:


          If set to Optional , signatures will be checked when present, but unsigned databases and packages will also be accepted.


          TrustedOnly (default) If a signature is checked, it must be in the keyring and fully trusted; marginal trust does not meet this criteria.

          So if you are installing a signed package the signature will be checked but an unsigned package will just get accepted blindly. Guess it’s a better check for corrupted downloads than md5 checksums but that’s not really any additional security.

          [1] - https://wiki.archlinux.org/index.php/Pacman/Package_signing

          [2] - https://www.archlinux.org/pacman/pacman.conf.5.html#SC

      2. 1

        @curtis but how do you do that windowing in the termnial? (or is that your text editor or something?)

        1. 3

          tmux and (neo)vim.

        2. 1

          I also did this for a while! Quick warning it’s hard on high dpi monitors you don’t get many fonts to choose.

          That said, each font is exactly designed for it’s size so each letter is impossibly crisp compared to xorg!

          1. 1

            Also gpm will give you some mouse support…

            1. 1

              Great writeup! Before moving to macOS, I sometimes switched to TTY-only full time for a few weeks or months to remove the pain in my right wrist (caused by mouse use).

              BTW: /etc/tmpfiles.d - Linux/systemd never ceases to amaze me :p.