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:
parent
2c1487ab93
commit
a70f1d226a
1 changed files with 21 additions and 0 deletions
21
sh/.config/sh/alias.d/top.sh
Normal file
21
sh/.config/sh/alias.d/top.sh
Normal 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
|
Loading…
Reference in a new issue