目次
tattoyを使ってターミナルの背景で動画を再生する。
またまたターミナルをド派手にするものを見つけてしまいました😂
その名もtattoy
ターミナルの背景に動画を設定できます。
Install tattoy
brew install tattoy-org/tap/tattoy
自分はcargoで入れてます。
cargo install --locked --git https://github.com/tattoy-org/tattoy tattoy
Install mpv
これも普通にbrewで入ります。
brew install mpv
config path
- Linux:
$HOME/.config/tattoy/tattoy.toml
. - MacOS:
$HOME/Library/Application Support/tattoy/tattoy.toml
tattoyはXDGに直接対応している感じじゃないっぽいので、symlinkしちゃう。
test ! -d ${HOME}/.config/tattoy && mkdir -p ${HOME}/.config/tattoy
ln -s ${HOME}/.config/tattoy "${HOME}/Library/Application Support/tattoy/tattoy.toml"
これはやってもやらなくても大丈夫です。
palette config
tattoyを初回起動すると

これは普通に y を押してください。
palette.tomlが初期化されます。
2025/06/16時点では、WezTermとかで背景画像を設定してるとparse-paletteがうまくいかないかもしれません。自分はうまくいきませんでした。なのでその場合は、dでも大丈夫です。
Config Setup
text_contrastを修正します。
enabled = trueにします。
[text_contrast]
enabled = true
target_contrast = 2.0
# When set to false, all text is automatically adjusted, even non-alphanumeric characters
# like UI border elements etc. The only characters that aren't adjusted are the UTF8
# half blocks (eg ▀) that are used to render "graphics", as in the shaders for example.
apply_to_readable_text_only = true
minimapを修正します。
enabled = trueにします。
[minimap]
enabled = true
animation_speed = 0.15
# The maximum width of the minimap. It can be narrower when the scrollback is long
# in order to maintain a consistent aspect ratio.
max_width = 10
カーソルを右端に持っていくとscroll minimapが表示されます。
bg_commandを修正します。
enabled = trueに修正し
commandを以下のように修正します。
[bg_command]
enabled = true
# The command to run. The executable goes in the first position and then each argument must
# be placed in its own quotes in the array.
# Examples:
# * Render a live-updating instance of the common monitoring application "top" in the background.
# `command = ["top"]`
# * Play the "Bad Apple" video in the background.
# `command = ["mpv", "--really-quiet", "--vo=tct", "--volume=0", "https://www.youtube.com/watch?v=UkgK8eUdpAo"]`
#command = ["echo", "Hello World"]
command = ["mpv", "--really-quiet", "--vo=tct", "--volume=0", "--loop-file=inf", "https://www.youtube.com/watch?v=yYnAw4_F0bU"]
# Do you expect the command to exit or not?
# Usually when a command exits Tattoy shows an error notification. But you may want to render a
# command that outputs some static content, for example to print out some ASCII-based image:
# `command = ["chafa", "/path/to/wallpaper.png"]`
# Bare in mind that there's currently no config to re-run the command on terminal resize.
expect_exit = false
opacity = 0.7
layer = -10
ここではYouTubeの動画を再生させます。
background loopで検索して選びました。
https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FyYnAw4_F0bU%3Ffeature%3Doembed&display_name=YouTube&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DyYnAw4_F0bU&image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FyYnAw4_F0bU%2Fhqdefault.jpg&type=text%2Fhtml&schema=youtube
t-recで録画しました。

ほんとに動画が再生されます😆
因みに、当たり前ですがめちゃくちゃCPUを食います😅
意味なんて探してはいけません🤣🤣🤣🤣
2025/06/16時点では、bashを使っていますがキーボードショートカットが使えなくなります。
私の環境ではbindで設定を読み込み直しても、今のところダメでした。
今後のUpdateに期待です。
Appendix: Shaders
tattoyはglslファイルを読み込めます。
ghosttyにghostty-shadersというリポジトリがありtattoy.tomlのshaderセクションを修正すると使えます。
[shader]
enabled = true
opacity = 0.2
layer = -2
# Whether to render the computed shader from the GPU. The shader pixels can still be
# used for other purposes such as defining the foreground colour of the terminal's text,
# see `render_shader_colours_to_text`.
render = true
# It can be useful to disable this for certain GUI terminal shaders (such as Ghostty shaders)
# that also take responsibility for rendering terminal text. Tattoy can only send a crude
# representation of terminal text as 2 pixels per character, which is sometimes desirable
# when the shader uses the terminal to inform the output of the shader, but it can also cause
# an unnesceray blocky effect when the shader doesn't use the terminal colours.
upload_tty_as_pixels = true
# Use each "cell" of the shader to set the corresponding text cell's foreground colour.
# This is most likely desirable in conjunction with the `render` option, so that the shader
# is only visible via the terminal's text.
render_shader_colours_to_text = true
# Path to a Shadertoy shader on your local filesystem. Is relative to the root of
# Tattoy's config directory.
#path = "shaders/soft_shadows.glsl"
path = "shaders/galaxy.glsl"
ここでは
enabled = true
layer = -2
bg_commandのlayerより手前に設定
path = “shaders/galaxy.glsl”
と設定して、bg_commandのmpv動画再生より手前のレイヤーでshaderを描画しています。
もちろん、動画再生だけでかなりのCPUを食いますが、shaderを同時に使うともっとCPUを食います🤣
ターミナル環境について他の記事も書いているので、よろしければこちらもご覧ください!
『ターミナルがダサいとモテない』シリーズ一覧
転載:ターミナルがダサいとモテない。tattoyでターミナルをド派手にしよう!

