LoginSignup
2
2

More than 5 years have passed since last update.

tmuxのstatus-lineにtwitterを表示させる遊び

Last updated at Posted at 2017-04-24

tのインストール&初期設定

$gem install t
$t authorize

t authorizeでアクセストークン取得のためのwebページが開くので,テキトーに埋めてaccess tokenとaccess secret tokenを取得しましょう.
(必須項目埋めても弾かれる場合→ 電話番号登録)

tmux.confに追記

tmux.conf
set -g status-left "#(t timeline -n 1)"

これでとりあえずは見られる.

ただstatus-interval 1とか指定してるとすぐにAPI切れになる…
多分一旦別ファイルに落としていって,そのファイルを監視したほうが効率良い.

ので,.tmux.confには,こんな感じで書いておいて

tmux.conf
set -g status-left "#(cat /tmp/tweet|tail -n 3|head -n 2|tr -d '\n')"

立ち上げ時に以下のコマンドを発火させるように

$t stream timeline>/tmp/tweet&

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2