Skip to content

Instantly share code, notes, and snippets.

View Andrew-liu's full-sized avatar

Andrew-liu Andrew-liu

View GitHub Profile
@Andrew-liu
Andrew-liu / zhuang_bi.sh
Created November 5, 2015 10:19
给打开命令行终端增加duangdaungduang的特效, 这个逼装的我给满分
#!/bin/bash
# Usage: copy the code into .zshrc config file
# Find out current screen width and hight
_COLUMNS=$(tput cols)
# Set default message if ( input not provided
_MESSAGE=" FBI Warining "
# Calculate x and y coordinates so that we can display $MESSAGE
# centered in the screen
y=$(( ( $_COLUMNS - ${#_MESSAGE} ) / 2 ))
spaces=$(printf "%-${y}s" " ")