LoginSignup
2
2

More than 3 years have passed since last update.

zshでtypoした時に好きな画像を出したい!

Last updated at Posted at 2019-07-19

探し方を忘れるので自分メモ。

$ typo
zsh: command not found: typo

これを

$ typo
[画像]
typoとかないっちゃろ?

にしたい。

を叶えるメモです。
要はtypoした時にしょんぼりしたりイラッとしたりするより好きな画像を見てよし今日もがんばるぞい!って言いたいなって言う話です(大袈裟)
職場で推しメンのセクシー画像だすようにしたらふぁーーーやらかしたファーーー!ってなりました。オススメ()

方法

iTerm2をDL

https://www.iterm2.com/downloads.html
https://qiita.com/noraworld/items/ea59c37e48ac0977cc72
version3以上で。

imgcatをインストール

iTerm2の公式からシェルスクリプトをコピーします

/usr/local/bin/imgcat

を編集モードで開いてコピーしたシェルスクリプトを貼り付け

ファイルに権限を付与

sudo chmod +x /usr/local/bin/imgcat

.zshrcに追記

  1 function command_not_found_handler()
  2 {
  3   if [ -e /usr/local/bin/imgcat ];then
  4     if [ -e ~/Pictures/command_not_found.jpg ];then
  5       imgcat ~/Pictures/command_not_found.jpg
  6     fi
  7   fi
  8   echo "$1とかないっちゃろ?"
  9
 10   return 127
 11 }

追記したら

source ~/.zshrc

して反映。

そしてtypoしてみる

タハー(ノ∀`)

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