Tech Tips

  1. プログラミング
  2. 324 view

インストール zsh してログイン時に格言を表示させる

Contents

目的

zshをインストールしてログイン時に格言を表示させるようにする。

インストール zsh

$ sudo apt-get update
$ sudo apt-get install zsh
$ zsh --version
zsh 4.3.17 (i686-pc-linux-gnu)

zshを通常使用するシェルにする

$ echo $SHELL
/bin/bash
$ cat /etc/shells
# /etc/shells: valid login shells
/bin/sh
/bin/dash
/bin/bash
/bin/rbash
/usr/bin/screen
/bin/zsh
/usr/bin/zsh
$ chsh
Password:
Changing the login shell for username
Enter the new value, or press ENTER for the default
    	Login Shell [/bin/bash]: /bin/zsh
--- Relogin ---
$ echo $SHELL
/bin/zsh

コンフィグ設定

$ vim .zshrc
# Validate Auto Complementing Function
autoload -U compinit
compinit
# Validate Auto cd Function
setopt auto_cd
# Validate Directory Moving History Function
setopt auto_pushd
# Validate Command Spell Check Function
setopt correct
$ source .zshrc

格言の表示設定

$ sudo apt-get install fortune
$ vim .zlogin
# Print a Random Adage
if (( $+commands[fortune] )); then
  fortune -a
  print
fi
以上

プログラミングの最近記事

  1. PlatformIO IDE for VSCode を使用して VSCode で Ardu…

  2. ROS Docker イメージで発生した GPG error の解消方法

  3. Streamlit で訪れた国を色づけした世界地図を作成できるアプリケーションを作成してみ…

  4. M5Stack Core2 for AWS – ESP32 IoT開発キットで…

  5. D3.js v7 で点・線・テキスト・ツールチップ・ズームを設定する方法

関連記事

PAGE TOP