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 | ||
|
|
9ae2f4d01b |
No files matched your search
@@ -1,19 +1,13 @@
|
|||||||
Copyright (c) 2020 Gauge Krahe
|
Copyright 2020 Gauge Krahe
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission to use, copy, modify, and/or distribute this software for any
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
in the Software without restriction, including without limitation the rights
|
copyright notice and this permission notice appear in all copies.
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
copies or substantial portions of the Software.
|
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
@@ -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"
|
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'
|
|
||||||
Reference in new issue
Block a user