LoginSignup
12
9

More than 5 years have passed since last update.

ログインが楽しくなる!screenfetchを使ってCentOSで遊んでみた

Last updated at Posted at 2018-02-15

screenfetchとは、Linuxのディストリビューションのロゴをアスキーアートで表示させてくれるものだが、今回はそれを使い、ログイン時に複数のパターンがランダムに出るようにして遊び心を加えてみた。

キャプチャ.PNG

ロゴ紹介

今回は以下のロゴを使用する。オプションをつけることで、例のようにそれぞれ表示することが出来る。

screenfetch -D 'CentOS'
cent.PNG

screenfetch -D 'Red Hat Linux'
rethut.PNG

screenfetch -D 'Mandrake'
hosi.PNG

screenfetch -D 'Fedora'
fedora.PNG

screenfetch -D 'pentax'
pengin.PNG

他にもロゴは沢山ある。気になる人は調べてみよう。

インストール方法

以下の順でインストールする

$ wget https://raw.githubusercontent.com/KittyKatt/screenFetch/master/screenfetch-dev

$ su -

# cp screenfetch-dev /usr/local/bin/screenfetch

# chmod 755 /usr/local/bin/screenfetch

設定

使用するユーザーのhomeディレクトリにある.bashrcファイルに下記を追記。
乱数を応用し、ログインする度に、コマンドがランダムに実行されるようにする。

.bashrc
SCREEN=$(echo "$(($RANDOM % 5))")

if [ "${SCREEN}" = "0" ]; then
     /usr/local/bin/screenfetch -D 'CentOS' 
elif [ "${SCREEN}" = "1" ]; then
     /usr/local/bin/screenfetch -D 'Red Hat Linux'
elif [ "${SCREEN}" = "2" ]; then
     /usr/local/bin/screenfetch -D 'Mandrake'
elif [ "${SCREEN}" = "3" ]; then
     /usr/local/bin/screenfetch -D 'Fedora'
elif [ "${SCREEN}" = "4" ]; then
     /usr/local/bin/screenfetch -D 'pentax'
fi

確認

以下のコマンドを入力して確認。無事、実行できれば成功。

. .bashrc

これで次回以降から、ログインする毎にランダムに表示される

12
9
1

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