Trim trailing whitespace, use tab indentation consistently

This should avoid conflicts in future pull requests.
pull/68/head
Hugo Locurcio 2020-04-28 19:11:01 +02:00
parent 57669c6198
commit dbaf18eb22
No known key found for this signature in database
GPG Key ID: 39E8F8BE30B0A49C
14 changed files with 328 additions and 330 deletions

View File

@ -1,10 +1,10 @@
Package: bashtop
Package: bashtop
Version: 0.0.0
Section: base
Priority: optional
Architecture: all
Depends: bash (>= 4.4),curl (>= 7.16.2), coreutils, sed, awk, grep
Maintainer: your_name <xxx@xxx.xxx>
Description: Resource monitor that shows usage
Maintainer: your_name <xxx@xxx.xxx>
Description: Resource monitor that shows usage
and stats for processor, memory, disks, network and processes
Homepage: https://github.com/aristocratos/bashtop

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
echo -e "[\033[1;32m done \033[0m]"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
echo -e "[\033[1;32m successfully removed \033[0m]"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
echo -e "[\033[1;32m starting intallation \033[0m]"

View File

@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
echo -e "[\033[1;33m removing packet from the system \033[0m]"

100
DEB/build
View File

@ -1,24 +1,24 @@
#!/bin/bash
#!/bin/bash
# this little script is just to automate the creation of the .deb package under debian and also the automatic installation of the bashtop program in the system.
# How does it work?
# this little script is just to automate the creation of the .deb package under debian and also the automatic installation of the bashtop program in the system.
# How does it work?
# ----
# It parses the bashtop file to retrieve the last version specified in the script to allow a fresh creation of the .deb package
# +by also retrieving the most recent version of the script then it proceeds to the installation ...
# It parses the bashtop file to retrieve the last version specified in the script to allow a fresh creation of the .deb package
# +by also retrieving the most recent version of the script then it proceeds to the installation ...
set -o errexit
#set -x # just for debuging
set -o errexit
#set -x # just for debuging
readonly file_src_location=../bashtop # bashtop location ^
readonly file_src_location=../bashtop # bashtop location ^
readonly ubin=usr/bin/
readonly file_name=${file_src_location##*/}
readonly ctrl_file=DEBIAN/control
readonly architecture=amd64 # for all architectures
readonly file_name=${file_src_location##*/}
readonly ctrl_file=DEBIAN/control
readonly architecture=amd64 # for all architectures
readonly root_uid=0
declare version build_version
declare version build_version
[[ ROOT::PERMISSION ]]
[[ ROOT::PERMISSION ]]
{
[[ $UID -ne ${root_uid} ]] && {
echo -e "require root user"
@ -26,90 +26,88 @@ declare version build_version
}
}
[[ ARGUMENTS::HANDLER ]]
{
[[ ARGUMENTS::HANDLER ]]
{
if [[ -n $1 ]] ; then
case $1 in
case $1 in
"--remove")
[[ -x /${ubin}/${file_name} ]] && {
dpkg --remove ${file_name}
test $? -eq 0 && exit 0
test $? -eq 0 && exit 0
}||{
echo -e "~ nothing todo: bashtop is removed "
exit 0
}
echo -e "~ nothing todo: bashtop is removed "
exit 0
}
;;
esac
fi
esac
fi
}
echo -e "+ building package ..."
sleep 1
[[ FILECHECK ]]
sleep 1
[[ FILECHECK ]]
{
#+ require bashtop file to read inside
#+ require bashtop file to read inside
[[ ! -f ${file_src_location} ]] && {
echo -e "undefine ${file_name}"
exit 3 # just a basic exit
exit 3 # just a basic exit
}|| {
echo -e "+ populate DEB folder "
[[ -d $ubin ]] || mkdir -p $ubin
`cp $file_src_location $ubin`
}
#+ require control file to write inside
#+ require control file to write inside
[[ ! -f ${ctrl_file} ]] && {
echo -e "undefined ${ctrl_file##*/}"
exit 3
}
}
[[ IO::SEMVERS ]]
echo -e "undefined ${ctrl_file##*/}"
exit 3
}
}
[[ IO::SEMVERS ]]
{
echo -e "+ fetching the lastest version of ${file_name}"
get_current_version () {
local watch_version=`grep -i "declare version" ${file_src_location}`
local semvers=${watch_version##*=}
echo ${semvers:1:-1}
echo ${semvers:1:-1}
}
set_new_version_ctrl() {
local catch_package_version=`grep -i version ${ctrl_file}`
local catch_package_version=`grep -i version ${ctrl_file}`
version=${catch_package_version%%:*}
build_version=${catch_package_version##*:}
[[ -n $1 ]] && build_version=$1
version+=": ${build_version}"
build_version=${catch_package_version##*:}
[[ -n $1 ]] && build_version=$1
version+=": ${build_version}"
echo -e "+ set new version control"
`sed -i "s/$catch_package_version/${version}/g" ${ctrl_file}`
}
set_new_version_ctrl $(get_current_version)
}
set_new_version_ctrl $(get_current_version)
}
[[ PACKAGER_BUILD::DEB ]]
[[ PACKAGER_BUILD::DEB ]]
{
build_for_debian_base (){
local debian_package_name=${file_name}_${build_version}-${architecture}.deb
build_for_debian_base (){
local debian_package_name=${file_name}_${build_version}-${architecture}.deb
#echo ${debian_package_name}
dpkg-deb --build ../DEB ${debian_package_name}
dpkg-deb --build ../DEB ${debian_package_name}
test $? -eq 0 && {
if [[ -f ${debian_package_name} ]] ;then
dpkg -i ${debian_package_name}
[[ $? -eq 0 ]] && {
exit $?
}||{
echo -e "Installation failed"
exit $?
}||{
echo -e "Installation failed"
exit $?
}
fi
}||{
echo -e "build failed"
exit 5
exit 5
}
}
build_for_debian_base
}

View File

@ -1,7 +1,7 @@
# ![bashtop](logo-t.png)
**Usage:** Linux resource monitor
**Language:** Bash
**Usage:** Linux resource monitor
**Language:** Bash
## Index
@ -71,7 +71,7 @@ Should work on most modern linux distributions with a truecolor capable terminal
## Dependencies
**[bash](https://www.gnu.org/software/bash/)** (v4.4 or later) Script functionality will most probably break with earlier versions.
**[bash](https://www.gnu.org/software/bash/)** (v4.4 or later) Script functionality will most probably break with earlier versions.
Bash version 5 is highly recommended to make use of $EPOCHREALTIME variable instead of a lot of external date command calls.
**[GNU Core Utilities](https://www.gnu.org/software/coreutils/)**
@ -90,13 +90,13 @@ Bash version 5 is highly recommended to make use of $EPOCHREALTIME variable inst
## Screenshots
Main UI showing details for a selected process.
Main UI showing details for a selected process.
![Screenshot 1](main.png)
Main menu.
Main menu.
![Screenshot 2](menu.png)
Options menu.
Options menu.
![Screenshot 3](options.png)
## Installation

508
bashtop

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,7 @@ theme[title]="#ee"
theme[hi_fg]="#90"
# Background color of selected item in processes box
theme[selected_bg]="#7e2626"
theme[selected_bg]="#7e2626"
# Foreground color of selected item in processes box
theme[selected_fg]="#ee"
@ -86,4 +86,4 @@ theme[download_end]="#b0a9de"
# Upload graph colors
theme[upload_start]="#510554"
theme[upload_mid]="#7d4180"
theme[upload_end]="#dcafde"
theme[upload_end]="#dcafde"

View File

@ -22,7 +22,7 @@ theme[title]="#cc"
theme[hi_fg]="#90"
# Background color of selected item in processes box
theme[selected_bg]="#ff"
theme[selected_bg]="#ff"
# Foreground color of selected item in processes box
theme[selected_fg]="#00"
@ -86,4 +86,4 @@ theme[download_end]="#ff"
# Upload graph colors
theme[upload_start]="#30"
theme[upload_mid]=""
theme[upload_end]="#ff"
theme[upload_end]="#ff"

View File

@ -22,7 +22,7 @@ theme[title]="#F8F8F2"
theme[hi_fg]="#F92672"
# Background color of selected item in processes box
theme[selected_bg]="#7a1137"
theme[selected_bg]="#7a1137"
# Foreground color of selected item in processes box
theme[selected_fg]="#F8F8F2"
@ -86,4 +86,4 @@ theme[download_end]="#ccaefc"
# Upload graph colors
theme[upload_start]="#570d33"
theme[upload_mid]="#cf277d"
theme[upload_end]="#fa91c7"
theme[upload_end]="#fa91c7"

View File

@ -22,7 +22,7 @@ theme[title]="#F8F8F2"
theme[hi_fg]="#F92672"
# Background color of selected item in processes box
theme[selected_bg]="#7a1137"
theme[selected_bg]="#7a1137"
# Foreground color of selected item in processes box
theme[selected_fg]="#F8F8F2"
@ -86,4 +86,4 @@ theme[download_end]="#ccaefc"
# Upload graph colors
theme[upload_start]="#570d33"
theme[upload_mid]="#cf277d"
theme[upload_end]="#fa91c7"
theme[upload_end]="#fa91c7"

View File

@ -22,7 +22,7 @@ theme[title]="#fdf6e3"
theme[hi_fg]="#b58900"
# Background color of selected items
theme[selected_bg]="#073642"
theme[selected_bg]="#073642"
# Foreground color of selected items
theme[selected_fg]="#d6a200"
@ -86,4 +86,4 @@ theme[download_end]="#a3a8f7"
# Upload graph colors
theme[upload_start]="#701c45"
theme[upload_mid]="#d33682"
theme[upload_end]="#f56caf"
theme[upload_end]="#f56caf"

View File

@ -22,7 +22,7 @@ theme[title]="#10"
theme[hi_fg]="#284d75"
# Background color of selected item in processes box
theme[selected_bg]="#15283d"
theme[selected_bg]="#15283d"
# Foreground color of selected item in processes box
theme[selected_fg]="#ff"
@ -86,4 +86,4 @@ theme[download_end]="#130f29"
# Upload graph colors
theme[upload_start]="#f590f9"
theme[upload_mid]="#722e76"
theme[upload_end]="#2b062d"
theme[upload_end]="#2b062d"