Skip to the content

The Textsmith manual

A command per machine

When your bookmarks travel between machines, in your dotfiles for instance, one name can stand for a different command on each:

#update: [:anvil "sudo apt update && sudo apt upgrade -y", :brainpower "sudo pacman -Syu", :hammer "sudo dnf update"]

update then runs the command for the machine it is on. Several machines can share a command (:anvil :forge "..."), and :* stands for any other machine. Each command can have places, defaults and <..> of its own. Commands go in double quotes (with \" for a quote inside) or in single quotes. On a machine with no command and no :*, the bookmark says so and runs nothing.

The machine’s name is the first of these that is set:

  1. the TEXTSMITH_MACHINE environment variable;
  2. a file called machine in The Textsmith’s folder, holding one line (keep it out of your dotfiles: it is what makes this machine different);
  3. the host name, from /etc/hostname, with nothing to set up.

A bookmark that belongs to one machine only needs no list at all: #update: sudo pacman -Syu.