sh: Add automatic top program selection

When invoking top it will automatically alias to a selection of newer
system monitoring software instead, using the first preferred
application it finds (e.g. bottom over btop++ over gotop over glances
and so on, ending with regular top).
This commit is contained in:
Marty Oehme 2025-01-04 11:38:56 +01:00
parent 2c1487ab93
commit a70f1d226a
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A

View file

@ -0,0 +1,21 @@
#!/usr/bin/env sh
## Use the preferred system monitoring application
# when invoking top.
if exist btm; then
alias top="btm"
elif exist btop; then
alias top="btop"
elif exist gotop; then
alias top="gotop"
elif exist glances; then
alias top="glances"
elif exist bpytop; then
alias top="bpytop"
elif exist bashtop; then
alias top="bashtop"
elif exist htop; then
alias top="htop"
elif exist top; then
alias top="top"
fi