mirror of
https://github.com/eepykate/fet.sh.git
synced 2026-11-07 16:01:03 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
75b665e153 | ||
|
|
a0ee667546 | ||
|
|
acec5ad4c5 | ||
|
|
b89c509aca | ||
|
|
3df3b25355 | ||
|
|
9dd1b3d698 | ||
|
|
3d615c8c91 | ||
|
|
ee56d6eed3 | ||
|
|
8c30f4a730 | ||
|
|
d336d54e98 |
No files matched your search
@@ -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`
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
echo
|
|
||||||
read -r host < /etc/hostname
|
|
||||||
printf '%7s@%s\n' "$USER" "$host"
|
|
||||||
|
|
||||||
print os "$ID"
|
|
||||||
print sh "${SHELL##*/}"
|
|
||||||
print wm "$wm"
|
|
||||||
print up "$up"
|
|
||||||
print gtk "${gtk# }"
|
|
||||||
print cpu "$vendor $cpu"
|
|
||||||
print mem "${mem}MB"
|
|
||||||
print host "$model"
|
|
||||||
print kern "$kernel"
|
|
||||||
print pkgs "$pkgs"
|
|
||||||
print term "$term"
|
|
||||||
|
|
||||||
printf ' '
|
printf ' '
|
||||||
for i in 1 2 3 4 5 6; do
|
for i in 1 2 3 4 5 6; do
|
||||||
printf '\033[9%sm▅▅' "$i"
|
printf '\033[9%sm▅▅' "$i"
|
||||||
done
|
done
|
||||||
printf '\033[0m\n\n'
|
printf '\033[0m\n'
|
||||||
|
}
|
||||||
|
|
||||||
|
print() {
|
||||||
|
[ "$2" ] && printf '\033[9%sm%6s\033[0m%b%s\n' \
|
||||||
|
"${accent:-4}" "$1" "${separator:- ~ }" "$2"
|
||||||
|
}
|
||||||
|
|
||||||
|
read -r host < /proc/sys/kernel/hostname
|
||||||
|
|
||||||
|
for i in ${info:-n user os sh wm up gtk cpu mem host kern pkgs term col n}; do
|
||||||
|
case $i in
|
||||||
|
n) echo;;
|
||||||
|
os) print os "$ID";;
|
||||||
|
sh) print sh "${SHELL##*/}";;
|
||||||
|
wm) print wm "$wm";;
|
||||||
|
up) print up "$up";;
|
||||||
|
gtk) print gtk "${gtk# }";;
|
||||||
|
gpu) print cpu "$vendor $cpu";;
|
||||||
|
mem) print mem "${mem}MB";;
|
||||||
|
host) print host "$model";;
|
||||||
|
kern) print kern "$kernel";;
|
||||||
|
pkgs) print pkgs "$pkgs";;
|
||||||
|
term) print term "$term";;
|
||||||
|
user) printf '%7s@%s\n' "$USER" "$host";;
|
||||||
|
col) col;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
Reference in new issue
Block a user