jpskill.com
💬 コミュニケーション コミュニティ

configuring-tmux

tmuxのステータスバー設定、フレームワークやプラグインの導入、ウィジェットやスクリプトの追加、複数ステータスバーの設定を行い、oh-my-tmux、Catppuccin、tmux-powerlineの利用や、天気・金融・時計・ニュースなどのウィジェット追加、設定変更のトラブルシューティング、新規環境でのtmuxセットアップを支援するSkill。

📜 元の英語説明(参考)

Configures tmux status bars, installs frameworks and plugins, adds widgets and scripts, and sets up multiple status bars. Use when working with oh-my-tmux, Catppuccin, or tmux-powerline; adding weather/finance/clock/news widgets; troubleshooting why bar changes aren't appearing; or setting up tmux on a new machine.

🇯🇵 日本人クリエイター向け解説

一言でいうと

tmuxのステータスバー設定、フレームワークやプラグインの導入、ウィジェットやスクリプトの追加、複数ステータスバーの設定を行い、oh-my-tmux、Catppuccin、tmux-powerlineの利用や、天気・金融・時計・ニュースなどのウィジェット追加、設定変更のトラブルシューティング、新規環境でのtmuxセットアップを支援するSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o configuring-tmux.zip https://jpskill.com/download/19232.zip && unzip -o configuring-tmux.zip && rm configuring-tmux.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/19232.zip -OutFile "$d\configuring-tmux.zip"; Expand-Archive "$d\configuring-tmux.zip" -DestinationPath $d -Force; ri "$d\configuring-tmux.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して configuring-tmux.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → configuring-tmux フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
2

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

[Skill 名] configuring-tmux

tmux の設定

ステップ 0: フレームワークの選択

設定に触れる前に、ユーザーにどのフレームワークを使用したいか尋ねてください。

オプション 1: oh-my-tmux

cd ~ && git clone https://github.com/gpakosz/.tmux.git
ln -sf .tmux/.tmux.conf .tmux.conf
cp .tmux/.tmux.conf.local .tmux.conf.local
  • ~/.tmux.conf.local 内の tmux_conf_theme_* 変数によるテーマ設定 — ~/.tmux.conf は決して編集しないでください。
  • 注意点: そのテーマレイヤーはバー 0 を所有し、生の set -g status-right を上書きします — 追加のバーには status-format[] を使用してください。

オプション 2: Catppuccin (TPM ベース、クローン不要)

set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @catppuccin_flavor 'mocha'
set -g @catppuccin_status_modules_right "application session date_time"
  • モジュールリストがバー 0 を制御します — status-right-append を介してカスタムの #() 呼び出しを追加してください。
  • 追加のバーは status-format[] を直接使用します。

オプション 3: tmux-powerline

git clone https://github.com/erikw/tmux-powerline.git ~/.config/tmux-powerline
set-option -g status-left "#(~/.config/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/.config/tmux-powerline/powerline.sh right)"
  • Nerd Font または Powerline パッチ適用済みフォントが必要です。
  • セグメントは ~/.config/tmux-powerline/segments/ にあります。

オプション 4: ユーザー提供のフレームワーク

リポジトリの URL、インストール方法、カスタマイズの場所、ステータスコンテンツの処理方法を尋ねてください。その後、以下のパターンを適用してください。


プラグイン設定 (すべてのフレームワーク)

# TPM をインストール
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm

# 必須プラグイン
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-cpu'          # #{cpu_percentage} #{ram_percentage}
set -g @plugin 'tmux-plugins/tmux-net-speed'    # #{net_speed_up} #{net_speed_down}

set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
set -g @resurrect-capture-pane-contents 'on'

run '~/.config/tmux/plugins/tpm/tpm'
# インストール: prefix + I

複数のステータスバー

tmux 3.2 以降は 2~5 本のバーをサポートしています。正しい構文は status-format[] 配列ですstatus2-right (無効、エラーになります) ではありません。

set -g status 3

# バー 1: ウィジェット行
set -g status-format[1] "#[bg=#1a1b26,fg=#c0caf5,align=right]#(~/.config/tmux/scripts/weather.sh)  #(~/.config/tmux/scripts/finance.sh)  #[fg=#1e3a8a,bg=#b8970d,bold]PT #(TZ=America/Los_Angeles date +%H:%M) EST #(TZ=America/New_York date +%H:%M)#[default]"

# バー 2: ニュースティッカー
set -g status-format[2] "#[bg=#16161e,fg=#e0af68,align=right]  #(~/.config/tmux/scripts/news-ticker.sh)"

status-position topstatus 3 の場合:

バー 0  ← フレームワークが所有 (oh-my-tmux / Catppuccin)
バー 1  ← status-format[1]  — 自由に設定
バー 2  ← status-format[2]  — 自由に設定
──────────────────────────────
ターミナルペイン

確認: tmux show-options -g status (合計バー数と一致する必要があります)


ウィジェットスクリプト

単一行出力ルール

#() 内のスクリプトは1 行を出力する必要があります。複数行出力はバーを破損させます。

キャッシュパターン (ネットワークスクリプトに必須)

#!/bin/bash
CACHE="/tmp/my-widget-cache"
CACHE_AGE=300

if [ -f "$CACHE" ]; then
    age=$(( $(date +%s) - $(stat -c %Y "$CACHE") ))
    [ "$age" -lt "$CACHE_AGE" ] && cat "$CACHE" && exit 0
fi

python3 << 'PYEOF' | tee "$CACHE"
# fetch and print ONE line
PYEOF

世界時計 (キャッシュ不要)

# status-format[] 内: %H:%M を直接使用
"PT #(TZ=America/Los_Angeles date +%H:%M) EST #(TZ=America/New_York date +%H:%M)"

# oh-my-tmux の tmux_conf_theme_status_right 内: % を %% にエスケープ
"PT #(TZ=America/Los_Angeles date +%%H:%%M)"

回転するニュースティッカー

#!/bin/bash
CACHE="/tmp/news-cache"  # 1 行に 1 つの見出し、バックグラウンドフェッチで更新
[ ! -s "$CACHE" ] && echo "Loading..." && exit 0
count=$(wc -l < "$CACHE")
idx=$(( ($(date +%s) / 20) % count ))   # 20 秒ごとに回転
sed -n "$((idx + 1))p" "$CACHE"

財務ウィジェット (Yahoo Finance v8)

-A "Mozilla/5.0" を使用してください — Yahoo はデフォルトの curl UA をブロックします:

curl -sf --max-time 4 -A "Mozilla/5.0 (X11; Linux x86_64)" \
  "https://query1.finance.yahoo.com/v8/finance/chart/BTC-USD?interval=1d&range=1d"

oh-my-tmux: バー 0 のリファレンス

# ~/.tmux.conf.local
tmux_conf_theme_status_right="#{prefix}#{mouse} 🌿 #[fg=#000,bg=#2ea043,bold]#(git -C #{pane_current_path} symbolic-ref --short HEAD 2>/dev/null)#[default] #[fg=#fff,bg=#cc1111,bold]⚡#{cpu_percentage}/💾#{ram_percentage}#[default]"
tmux_conf_theme_status_right_fg="#000000,#000000,#000000"
tmux_conf_theme_status_right_bg="#2ea043,#1155cc,#2ea043"
tmux_conf_theme_status_right_length=300

よくある間違い

間違い 修正
set -g status-right が上書きされる tmux_conf_theme_status_right= (oh-my-tmux) またはフレームワークの同等機能を使用してください
status2-right → 無効なオプション set -g status-format[1] "..." を使用してください
新しいバーが表示されない tmux show-options -g status がバーの数と一致する必要があります
バーが空白になる スクリプトは正確に 1 行の空でない行を出力する必要があります
スクリプトはターミナルでは動作するが、バーでは空白になる tmux の #() は最小限の PATH しか持っていません — ~/ または絶対パスを使用してください
%%% の混同 tmux_conf_theme_* では %%status-format[] では %H:%M を直接使用してください

リロード

tmux source-file ~/.tmux.conf        # フルリロード (フレームワークのテーマ設定を再適用)
tmux source-file ~/.tmux.conf.local  # ローカルのオーバーライドのみ
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

Configuring tmux

Step 0: Choose a Framework

Ask the user which framework they want before touching any config.

Option 1: oh-my-tmux

cd ~ && git clone https://github.com/gpakosz/.tmux.git
ln -sf .tmux/.tmux.conf .tmux.conf
cp .tmux/.tmux.conf.local .tmux.conf.local
  • Theming via tmux_conf_theme_* variables in ~/.tmux.conf.local — never edit ~/.tmux.conf
  • Gotcha: its theming layer owns bar 0 and overrides raw set -g status-right — use status-format[] for extra bars

Option 2: Catppuccin (TPM-based, no clone needed)

set -g @plugin 'catppuccin/tmux#v2.1.3'
set -g @catppuccin_flavor 'mocha'
set -g @catppuccin_status_modules_right "application session date_time"
  • Module list controls bar 0 — add custom #() calls via status-right-append
  • Extra bars use status-format[] directly

Option 3: tmux-powerline

git clone https://github.com/erikw/tmux-powerline.git ~/.config/tmux-powerline
set-option -g status-left "#(~/.config/tmux-powerline/powerline.sh left)"
set-option -g status-right "#(~/.config/tmux-powerline/powerline.sh right)"
  • Requires Nerd Font or Powerline-patched font
  • Segments live in ~/.config/tmux-powerline/segments/

Option 4: User-provided framework

Ask for: repo URL, install method, where customizations live, how it handles status content. Then apply the patterns below.


Plugin Setup (all frameworks)

# Install TPM
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm

# Essential plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
set -g @plugin 'tmux-plugins/tmux-cpu'          # #{cpu_percentage} #{ram_percentage}
set -g @plugin 'tmux-plugins/tmux-net-speed'    # #{net_speed_up} #{net_speed_down}

set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
set -g @resurrect-capture-pane-contents 'on'

run '~/.config/tmux/plugins/tpm/tpm'
# Install: prefix + I

Multiple Status Bars

tmux 3.2+ supports 2–5 bars. The correct syntax is status-format[] array — not status2-right (invalid, will error).

set -g status 3

# Bar 1: widgets row
set -g status-format[1] "#[bg=#1a1b26,fg=#c0caf5,align=right]#(~/.config/tmux/scripts/weather.sh)  #(~/.config/tmux/scripts/finance.sh)  #[fg=#1e3a8a,bg=#b8970d,bold]PT #(TZ=America/Los_Angeles date +%H:%M) EST #(TZ=America/New_York date +%H:%M)#[default]"

# Bar 2: news ticker
set -g status-format[2] "#[bg=#16161e,fg=#e0af68,align=right]  #(~/.config/tmux/scripts/news-ticker.sh)"

With status-position top and status 3:

Bar 0  ← framework owns (oh-my-tmux / Catppuccin)
Bar 1  ← status-format[1]  — configure freely
Bar 2  ← status-format[2]  — configure freely
──────────────────────────────
Terminal panes

Verify: tmux show-options -g status (must equal your total bar count)


Widget Scripts

Single-line output rule

Scripts in #() must emit one line. Multi-line output corrupts the bar.

Caching pattern (required for network scripts)

#!/bin/bash
CACHE="/tmp/my-widget-cache"
CACHE_AGE=300

if [ -f "$CACHE" ]; then
    age=$(( $(date +%s) - $(stat -c %Y "$CACHE") ))
    [ "$age" -lt "$CACHE_AGE" ] && cat "$CACHE" && exit 0
fi

python3 << 'PYEOF' | tee "$CACHE"
# fetch and print ONE line
PYEOF

World clocks (no cache needed)

# In status-format[]: use %H:%M directly
"PT #(TZ=America/Los_Angeles date +%H:%M) EST #(TZ=America/New_York date +%H:%M)"

# In oh-my-tmux tmux_conf_theme_status_right: escape % as %%
"PT #(TZ=America/Los_Angeles date +%%H:%%M)"

Rotating news ticker

#!/bin/bash
CACHE="/tmp/news-cache"  # one headline per line, refreshed by background fetch
[ ! -s "$CACHE" ] && echo "Loading..." && exit 0
count=$(wc -l < "$CACHE")
idx=$(( ($(date +%s) / 20) % count ))   # rotates every 20s
sed -n "$((idx + 1))p" "$CACHE"

Finance widget (Yahoo Finance v8)

Use -A "Mozilla/5.0" — Yahoo blocks default curl UA:

curl -sf --max-time 4 -A "Mozilla/5.0 (X11; Linux x86_64)" \
  "https://query1.finance.yahoo.com/v8/finance/chart/BTC-USD?interval=1d&range=1d"

oh-my-tmux: Bar 0 Reference

# ~/.tmux.conf.local
tmux_conf_theme_status_right="#{prefix}#{mouse} 🌿 #[fg=#000,bg=#2ea043,bold]#(git -C #{pane_current_path} symbolic-ref --short HEAD 2>/dev/null)#[default] #[fg=#fff,bg=#cc1111,bold]⚡#{cpu_percentage}/💾#{ram_percentage}#[default]"
tmux_conf_theme_status_right_fg="#000000,#000000,#000000"
tmux_conf_theme_status_right_bg="#2ea043,#1155cc,#2ea043"
tmux_conf_theme_status_right_length=300

Common Mistakes

Mistake Fix
set -g status-right overridden Use tmux_conf_theme_status_right= (oh-my-tmux) or framework equivalent
status2-right → invalid option Use set -g status-format[1] "..."
New bars not visible tmux show-options -g status must equal bar count
Bar appears blank Script must output exactly one non-empty line
Script works in terminal, blank in bar tmux #() has minimal PATH — use ~/ or absolute paths
%% vs % confusion %% in tmux_conf_theme_*; %H:%M directly in status-format[]

Reload

tmux source-file ~/.tmux.conf        # full reload (re-applies framework theming)
tmux source-file ~/.tmux.conf.local  # local overrides only

同梱ファイル

※ ZIPに含まれるファイル一覧。`SKILL.md` 本体に加え、参考資料・サンプル・スクリプトが入っている場合があります。