10 Commits
Author SHA1 Message Date
GaugeK 75b665e153 add field to print newline 2020-08-19 05:27:15 +10:00
GaugeK a0ee667546 Add env var to change what info is displayed 2020-08-19 05:21:48 +10:00
gk acec5ad4c5 Merge pull request #12 from tumpura/master
change where hostname is read.
2020-08-19 05:18:19 +10:00
tumpura b89c509aca change where hostname is read. 2020-08-18 22:12:34 +03:00
gk 3df3b25355 Merge pull request #11 from elkowar/fix/unphuck_readme
Clean up the README file
2020-08-19 04:07:06 +10:00
gk 9dd1b3d698 Merge pull request #10 from elkowar/feature/customize_seperator
make seperator between key and value configurable via an env variable
2020-08-19 04:00:58 +10:00
elkowar 3d615c8c91 make seperator between key and value configurable via an env variable 2020-08-18 20:00:08 +02:00
elkowar ee56d6eed3 Clean up the README file
Adds documentation regarding how to customize the output, as well as phix
the phormatting.
2020-08-18 19:48:27 +02:00
GaugeK 8c30f4a730 update package name 2020-08-18 12:33:04 +10:00
GaugeK d336d54e98 add AUR package info to readme 2020-08-18 10:30:56 +10:00
2 changed files with 43 additions and 24 deletions

No files matched your search

+15 -3
View File
@@ -1,8 +1,20 @@
<h2 align="center">fet.sh</h1>
<div align="center"> <div align="center">
<h1>fet.sh</h1>
fetch written in POSIX shell with no external commands fetch written in POSIX shell with no external commands
<br> <br>
<img src="screenshot.png" width="250px"> <img src="screenshot.png" width="250px">
</div> </div>
### Installing
**Arch:** [fet.sh-git](https://aur.archlinux.org/packages/fet.sh-git/) (AUR)
**Other Distros:** copy `fet.sh` to somewhere in $PATH
### Customization
`fet.sh` can be configured using environment variables, for example:
```
$ info='n os wm sh n' fet.sh
```
Supported options are:
- `accent` (0-7)
- `info`
- `separator`
+28 -21
View File
@@ -99,29 +99,36 @@ read -r model < /sys/devices/virtual/dmi/id/product_name
[ -d /var/db/pkg ] && set -- /var/db/pkg/*/* [ -d /var/db/pkg ] && set -- /var/db/pkg/*/*
[ $# -gt 0 ] && pkgs=$# [ $# -gt 0 ] && pkgs=$#
print() { col() {
[ "$2" ] && printf '\033[3%sm%6s\033[0m ~ %s\n' "${accent:-4}" "$1" "$2" printf ' '
for i in 1 2 3 4 5 6; do
printf '\033[9%sm▅▅' "$i"
done
printf '\033[0m\n'
} }
print() {
[ "$2" ] && printf '\033[9%sm%6s\033[0m%b%s\n' \
"${accent:-4}" "$1" "${separator:- ~ }" "$2"
}
echo read -r host < /proc/sys/kernel/hostname
read -r host < /etc/hostname
printf '%7s@%s\n' "$USER" "$host"
print os "$ID" for i in ${info:-n user os sh wm up gtk cpu mem host kern pkgs term col n}; do
print sh "${SHELL##*/}" case $i in
print wm "$wm" n) echo;;
print up "$up" os) print os "$ID";;
print gtk "${gtk# }" sh) print sh "${SHELL##*/}";;
print cpu "$vendor $cpu" wm) print wm "$wm";;
print mem "${mem}MB" up) print up "$up";;
print host "$model" gtk) print gtk "${gtk# }";;
print kern "$kernel" gpu) print cpu "$vendor $cpu";;
print pkgs "$pkgs" mem) print mem "${mem}MB";;
print term "$term" host) print host "$model";;
kern) print kern "$kernel";;
printf ' ' pkgs) print pkgs "$pkgs";;
for i in 1 2 3 4 5 6; do term) print term "$term";;
printf '\033[9%sm▅▅' "$i" user) printf '%7s@%s\n' "$USER" "$host";;
col) col;;
esac
done done
printf '\033[0m\n\n'