monochromatic

monochromatic blog: http://blog.z3bra.org
git clone git://z3bra.org/monochromatic
Log | Files | Refs

commit f456c716360226c645a81c6ff3b8497766db2ba4
parent 6ac31d239783d77e0d1665654a698de5be636ced
Author: z3bra <willy@mailoo.org>
Date:   Fri, 27 Mar 2015 21:50:41 +0100

added a data directory

Diffstat:
2013/10/home-sweet-home.txt | 2+-
config.mk | 2+-
data/info.sh | 61+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 63 insertions(+), 2 deletions(-)

diff --git a/2013/10/home-sweet-home.txt b/2013/10/home-sweet-home.txt @@ -232,7 +232,7 @@ I wrote a small script for the purpose: [![term screenshot](/img/thumb/2013-10-28-term.jpg)](/img/2013-10-28-term.jpg) <span class='caption'>A terminal running the script -[info.sh](http://git.z3bra.org/cgit.cgi/scripts/tree/info.sh) that dump 16 +[info.sh](http://blog.z3bra.org/data/info.sh) that dump 16 colors along system informations</span> <h3 id='sh'>Shell</h3> diff --git a/config.mk b/config.mk @@ -27,4 +27,4 @@ PAGES = index.html \ 2015/02/do-you-gopher.html FEEDS = rss/feed.xml -EXTRA = css img vid errors favicon.ico +EXTRA = css img vid data errors favicon.ico diff --git a/data/info.sh b/data/info.sh @@ -0,0 +1,61 @@ +#!/bin/sh + +gitdir=http://git.z3bra.org +myblog=http://blog.z3bra.org + +c00=$'\e[0;30m' +c01=$'\e[0;31m' +c02=$'\e[0;32m' +c03=$'\e[0;33m' +c04=$'\e[0;34m' +c05=$'\e[0;35m' +c06=$'\e[0;36m' +c07=$'\e[0;37m' +c08=$'\e[1;30m' +c09=$'\e[1;31m' +c10=$'\e[1;32m' +c11=$'\e[1;33m' +c12=$'\e[1;34m' +c13=$'\e[1;35m' +c14=$'\e[1;36m' +c15=$'\e[1;37m' + +f0=$'\e[1;30m' +f1=$'\e[1;37m' +f2=$'\e[0;37m' + +kernel=`uname -rmo` +cpuspe="`sed -n '/model\ name/s/^.*:\ //p' /proc/cpuinfo | uniq` (x`nproc`)" +system=`sed 's/\s*[\(\\]\+.*$//' /etc/issue` + +if [ -n "$DISPLAY" ]; then + wmname=`xprop -root WM_NAME|cut -d\" -f2` + termfn=`sed -n 's/^.*\*font:\s* -\*-\([^-]*\)-.*/\1/p' ~/.Xresources|sed 1q` + systfn=`sed -n 's/^.*font.*"\(.*\)".*$/\1/p' ~/.gtkrc-2.0` +else + wmname="none" + termfn="none" + systfn="none" +fi + +pkgnum=`pacman -Q|wc -l` +birthd=`sed -n '1s/^\[\([0-9-]*\).*$/\1/p' /var/log/pacman.log | tr - .` + +cat << EOF +${c00}▉▉ | ${f1}OS ${f0}........... $f2$system +${c08} ▉▉| ${f1}name ${f0}......... $f2$HOSTNAME +${c01}▉▉ | ${f1}birth day${f0}..... $f2$birthd +${c09} ▉▉| ${f1}packages ${f0}..... $f2$pkgnum +${c02}▉▉ | +${c10} ▉▉| ${f1}wm ${f0}........... $f2$wmname +${c03}▉▉ | ${f1}shell ${f0}........ $f2$SHELL +${c11} ▉▉| ${f1}terminal ${f0}..... $f2$TERM +${c04}▉▉ | ${f1}term font ${f0}.... $f2$termfn +${c12} ▉▉| ${f1}system font ${f0}.. $f2$systfn +${c05}▉▉ | +${c13} ▉▉| ${f1}kernel ${f0}....... $f2$kernel +${c06}▉▉ | ${f1}processor ${f0}.... $f2$cpuspe +${c14} ▉▉| +${c07}▉▉ | ${f1}blog ${f0}......... $f2$myblog +${c15} ▉▉| ${f1}git repos ${f0}.... $f2$gitdir +EOF