Created
December 1, 2014 21:50
-
-
Save 844196/9007ffde3dc11b51b636 to your computer and use it in GitHub Desktop.
ターミナルが256色使えるかどうか確認するスクリプトです
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# @(#) ターミナルが256色使えるかどうか確認するスクリプトです | |
# | |
# Author: | |
# 844196 (@84____) | |
# | |
# License: | |
# WTFPL 2.0 | |
# | |
Y="\033[48;5;236m \033[m" | |
J="\033[48;5;137m \033[m" | |
U="\033[48;5;180m \033[m" | |
function _CursorInvisible() { | |
trap "clear; tput cnorm;" EXIT | |
trap "clear; tput cnorm; exit 1" SIGINT | |
tput sc; tput cup 0 0; tput civis | |
} | |
function _Sleep() { | |
local t="${@}" | |
if $(which sleepenh >/dev/null 2>&1); then | |
local sleep='sleepenh' | |
else | |
local sleep='sleep' | |
fi | |
${sleep} ${t} >/dev/null | |
} | |
function _MarginHeight() { | |
local height=$(tput lines) | |
local m=$(expr ${height} - ${1}) | |
for i in $(seq 1 ${m}); do | |
echo " " | |
done | |
} | |
function NAXTU() { | |
_MarginHeight 31; | |
local NAXTU=" | |
$Y$Y$Y$Y$Y$Y$Y | |
$J$J$U$U$Y$Y$Y$Y$Y$Y | |
$J$J$U$U$U$U$U$U$Y$Y$Y$Y$Y | |
$J$U$Y$Y$U$U$U$U$U$U$U$Y$Y$Y$Y | |
$J$U$U$U$Y$Y$U$U$U$U$U$U$U$Y$Y$Y$Y | |
$J$U$U$Y$Y$U$Y$Y$U$U$U$U$U$U$U$Y$Y$Y$Y | |
$J$J$U$U$U$U$U$Y$Y$Y$U$U$U$U$U$U$U$J$Y$Y$Y | |
$J$J$U$U$U$U$U$U$U$U$U$Y$Y$Y$U$U$U$U$J$Y$Y$Y$Y | |
$J$J$U$U$U$J$J$J$J$J$U$Y$Y$Y$Y$Y$U$U$J$U$J$Y$Y$Y | |
$J$J$U$U$U$U$J$Y$J$U$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