Home

Awesome

Tut - a Mastodon TUI

Release web tut tut-bin @tut

A TUI for Mastodon with vim inspired keys. The program has most of the features you can find in the web client.

Press C to create a new toot and N to focus on your notifications.

You can also enable mouse support.

You can find Linux binaries under releases.

Preview Preview 2

Table of contents

Currently supported commands

Keys without description in tut

Explanation of the non obvious keys when viewing a toot

Configuration

Tut is configurable, so you can change things like the colors, the default timeline, what image viewer to use and some more. Check out the configuration file to see all the options.

You find it in XDG_CONFIG_HOME/tut/config.toml on Linux which usually equals to ~/.config/tut/config.toml. If you don't run Linux it will use the path of os#UserConfigDir. But if you move the tut folder to XDG_CONFIG_HOME/tut/ and have set the environment variable XDG_CONFIG_HOME it will look there instead of the standard place.

You can find an updated configuration file in this repo named config.example.toml. If there are any new configurations options you can copy them frome that file. If you prefer a website you can read about all the options on tut.anv.nu and if man pages are your thing use tut(5).

Install instructions

Binary releases

Head over to https://github.com/RasmusLindroth/tut/releases

Arch and Manjaro

You can find it in the Arch User Repository (AUR). I'm the maintainer there.

https://aur.archlinux.org/packages/tut/ https://aur.archlinux.org/packages/tut-bin/

You can also use tut-mastodon. Currently aur/tut collides with a package named tut if you're running Manjaro ARM. So if you face the same problem you can use this package instead. I suggest you add an alias for tut-mastodon to tut in the config for your shell. Usually .bashrc or .zshrc.

alias tut='tut-mastodon'

https://aur.archlinux.org/packages/tut-mastodon/

Alpine Linux

tut package is available in the community repository.

https://pkgs.alpinelinux.org/package/edge/community/x86_64/tut

Debian

http://packages.azlux.fr/

FreeBSD

https://www.freshports.org/net-im/tut

OpenBSD

https://openports.pl/path/net/tut

The tut is available since OpenBSD 7.3. It can be installed with:

pkg_add tut

NetBSD (and others)

Available as net/tut in pkgsrc, NetBSD's portable package manager. Also for Linux, macOS, Illumos, etc. Install from the tree or with pkgin:

pkgin install tut

Homebrew (macOS)

Available as a Homebrew Formulae over here. Install it like this:

brew update
brew install tut

openSUSE

tut package is shipped as part of openSUSE Tumbleweed and openSUSE Leap 15.5+. It can be installed via:

sudo zypper in tut

suntorytimed is the maintainer of the package.

Build it yourself

If you don't use the binary that you find under releases you will need Go. Use a newer one that supports modules.

# Fetches and installs tut. Usally /home/user/go/bin
go install github.com/RasmusLindroth/tut@latest

# You can also clone the repo if you like
# First clone this repository
git clone https://github.com/RasmusLindroth/tut.git

# Go to that folder
cd tut

# Build or install

# Install (usually /home/user/go/bin)
go install

# Build (same directory i.e. ./ )
go build

If you choose to install and want to be able to just run tut you will have to add go/bin to your $PATH.

Flags and commands

Commands:
    example-config - creates the default configuration file in the current directory and names it ./config.example.toml

Flags:
	-h  --help             prints this message
	-v  --version          prints the version
	-n  --new-user         add one more user to tut
	-c  --config <path>    load config.toml from <path>
	-d --config-dir <path> load all config from <path>
	-u  --user <name>      login directly to user named <name>
      If you want to login to multiple accounts separate them with a space and use quotation marks. E.g. -u "acc_one acc_two"
      If two users are named the same. Use full name like tut@fosstodon.org

If you don't want to set --config or --config-dir everytime you can set the environment variables TUT_CONF and TUT_CONF_DIR instead.

Templates

You can customise how toots and user profiles are displayed with a Go text/template.

You'll have to place a file named toot.tmpl and/or user.tmpl in XDG_CONFIG_HOME/tut/ which usually equals to ~/.config/tut/.

You can copy ./config/toot.tmpl and ./config/user.tmpl from this repo manually or with curl or wget.

cd ~/.config/tut

# using curl
curl -o toot.tmpl https://raw.githubusercontent.com/RasmusLindroth/tut/master/config/toot.tmpl

curl -o user.tmpl https://raw.githubusercontent.com/RasmusLindroth/tut/master/config/user.tmpl

# using wget
wget https://raw.githubusercontent.com/RasmusLindroth/tut/master/config/toot.tmpl

wget https://raw.githubusercontent.com/RasmusLindroth/tut/master/config/user.tmpl

The data available for you in toot.tmpl is two structs. The first one is the Toot-struct, you can see all fields in ./ui/item_status.go. The second one is the Style-struct. You can find the fields for style in ./config/config.go.

You acces them with .Toot and .Style in your template file.

The data available in user.tmpl is almost the same. You still have the Style but instead of Toot you have a struct named User. You can see all fields in ./ui/item_user.go.

Mouse support

To enable mouse support you'll have to set mouse-support=true under [general] in your config.

Password manager for secrets

If you run pass, gopass or something similar you can protect your secrets. You'll have to manually update your accounts.toml. It should be located at ~/.config/tut/accounts.toml. Currently you can only hide ClientID, ClientSecret and AccessToken. The command must be prefixed with !CMD!. Here's an example of what the file can look like.

[[Accounts]]
Name = 'tut'
Server = 'https://fosstodon.org'
ClientID = '!CMD!gopass show -o -f misc/tut-id'
ClientSecret = '!CMD!gopass show -o -f misc/tut-secret'
AccessToken = '!CMD!gopass show -o -f misc/tut-token'

Thanks to