9
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ターミナルで(˘ω˘)をクルクルさせてみる

Posted at

なんとなくやりたくなったのでやってみた(˘ω˘)

(˘ω˘)

.bashrc
get_syala() {
	COUNT=`cat ~/syala`
	if [ ${COUNT} -lt 6 ] ; then
		echo $((COUNT++)) > /dev/null
		echo $((COUNT++)) > ~/syala
	else
		COUNT=1
		echo 1 > ~/syala
	fi

	case ${COUNT} in
		1 ) SYALA="( ˘ω˘ )" ;;
		2 ) SYALA="(  ˘ω˘)" ;;
		3 ) SYALA="(   ˘ω)" ;;
		4 ) SYALA="(    ˘)" ;;
		5 ) SYALA="(˘    )" ;;
		6 ) SYALA="(ω˘   )" ;;
		7 ) SYALA="(˘ω˘  )" ;;
	esac

	echo "${SYALA}"
}

export PS1='$(get_syala) $ '
terminal
$ source ~/.bashrc
( ˘ω˘ ) $
(   ˘ω) $
(    ˘) $
(˘    ) $
(ω˘   ) $
(˘ω˘  ) $
( ˘ω˘ ) $

##終わりに
今回は(˘ω˘)の状態をテキストファイルに書き出して実現させたので、
複数ターミナルを開いていると(˘ω˘)の状態が飛んでしまうのでいつかなんとかしたい

もっとスマートな方法があれば誰か教えてください(˘ω˘)

9
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
9
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?