fetch

A MSYS2-compatible sys-info prompt
Log | Files | Refs | README | LICENSE

commit d606d3dca5130f638183840375c6f22c46d41ff2
parent e665fcedd99d03370f6b26c147a12b2553da083a
Author: Byron Torres <b@torresjrjr>
Date:   Fri, 29 Jan 2021 10:52:51 +0000

Complete README.md

Diffstat:
MREADME.md | 21++++++++++++++++++++-
Mfetch | 49++++++++++++++++++++++++-------------------------
2 files changed, 44 insertions(+), 26 deletions(-)

diff --git a/README.md b/README.md @@ -1,3 +1,22 @@ # fetch -A fetch for MSYS2 on Windows. +A small, colourful system infomation prompt for [MSYS2][1] on Windows. +Written in hackable POSIX sh. + +``` +$ fetch + ~ User@Hostname Mon, 25 Jan 2021 12:30:45 +0000 + .-. os: Msys + /`v`\ kernel: MSYS_NT-10.0-19042 3.1.7-340.x86_64 + (/ \) shell: /usr/bin/bash +======"="===< sshd: 2384 3122 3198 + |_| tmux: main:2w@ project:3w + +``` + +Configure the graphic and status by editing the source to your liking, +suckless style. Improvements are welcome. + + + [1]: https://www.msys2.org/ + diff --git a/fetch b/fetch @@ -3,7 +3,7 @@ # @torresjrjr -## Prepare colours +## Colours and cursor util c0=$(printf '\e[0m' ) c1=$(printf '\e[31m'); c2=$(printf '\e[32m') c3=$(printf '\e[33m'); c4=$(printf '\e[34m') @@ -11,20 +11,30 @@ c5=$(printf '\e[35m'); c6=$(printf '\e[36m') c7=$(printf '\e[37m'); c8=$(printf '\e[38m') -## Prepare graphic -graphic_y=7 -graphic_x=15 +reposition_cursor() { + printf '\r' + for i in $(seq ${graphic_y}); do printf '\e[A'; done +} + +padding() { + for i in $(seq ${graphic_x}); do printf '\e[C'; done +} + + +## Graphic +graphic_y=7 # height +graphic_x=15 # width graphic() { - #d=':::::::::::::::::::::::::::::::::::::::::::::' # status background + #b=':::::::::::::::::::::::::::::::::::::::::::::' # status background printf "\ -${c2} ~ ${d} -${c2} .-. ${d} -${c2} /\`v\`\\ ${d} -${c2} (/ \\) ${d} -${c2}======\"=\"===< ${d} -${c2} |_| ${d} -${c2} ${d}${c0} +${c2} ~ ${b} +${c2} .-. ${b} +${c2} /\`v\`\\ ${b} +${c2} (/ \\) ${b} +${c2}======\"=\"===< ${b} +${c2} |_| ${b} +${c2} ${b}${c0} " } @@ -33,18 +43,7 @@ palette() { } -## Cursor util -reposition_cursor() { - printf '\r' - for i in $(seq ${graphic_y}); do printf '\e[A'; done -} - -padding() { - for i in $(seq ${graphic_x}); do printf '\e[C'; done -} - - -## Prepare statuslines +## Statuslines _title() { user="${USER}" host=$(hostname) @@ -76,7 +75,7 @@ _tmux() { } -## Prepare status +## Status status() { padding; _title "${c5}%s@%s${c3} %s\n" padding; _os "${c6}os: ${c0}%s\n"