diff --git a/README.md b/README.md index 5fea9cc..79f802f 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ * [Compability](#compability) * [Dependencies](#dependencies) * [Screenshots](#screenshots) -* [Installation](#installation) +* [Installation](#installation) (Updated) * [Configurability](#configurability) * [TODO](#todo) (Updated) * [License](#license) @@ -92,25 +92,31 @@ Options menu. ## Installation +#### Manual installation + Copy or link "bashtop" into PATH, or just run from cloned directory... -Also available in the Arch Linux repository as [bashtop](https://www.archlinux.org/packages/community/any/bashtop/) +#### Arch based + +Available in the Arch Linux repository as [bashtop](https://www.archlinux.org/packages/community/any/bashtop/) Also available in the AUR as [bashtop-git](https://aur.archlinux.org/packages/bashtop-git/) -Also available for debian/ubuntu from [Azlux's repository](http://packages.azlux.fr/) +#### Debian based -Or use quick installation - ->quick install go to DEB folder and type +Available for debian/ubuntu from [Azlux's repository](http://packages.azlux.fr/) -``` +Or use quick installation: + +>Quick install go to DEB folder and type + +``` bash sudo ./build ``` ->to uninstall it go to DEB folder and type +>to uninstall it go to DEB folder and type -``` +``` bash sudo ./build --remove ``` diff --git a/bashtop b/bashtop index 3d643f7..d56959a 100755 --- a/bashtop +++ b/bashtop @@ -194,7 +194,7 @@ init_() { #? Collect needed information and set options before startig main loop local param_var if [[ -e /usr/include/asm-generic/param.h ]]; then param_var="$(=100)); then cur_value=10 elif [[ ${#org_value} -gt 1 && ${org_value:(-1)} -ge 5 ]]; then cur_value=$((${org_value::1}+1)) elif [[ ${#org_value} -gt 1 && ${org_value:(-1)} -lt 5 ]]; then cur_value=$((${org_value::1})) elif [[ ${org_value:(-1)} -ge 5 ]]; then cur_value=1 @@ -1356,14 +1356,14 @@ collect_cpu() { #? Collects cpu stats from /proc/stat and compares with previous done #* Get current cpu frequency from "/proc/cpuinfo" and convert to appropriate unit - if [[ -z ${cpu[no_cpu_info]} ]] && ! get_value -v cpu[freq] -sf "/proc/cpuinfo" -k "cpu MHz" -i; then + if [[ -z ${cpu[no_cpu_info]} ]] && ! get_value -v 'cpu[freq]' -sf "/proc/cpuinfo" -k "cpu MHz" -i; then cpu[no_cpu_info]=1 fi #* If getting cpu frequency from "proc/cpuinfo" was unsuccessfull try "/sys/devices/../../scaling_cur_freq" if [[ -n ${cpu[no_cpu_info]} && -e "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" ]]; then - get_value -v cpu[freq] -sf "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" -i - printf -v cpu[freq] "%.0f0" "${cpu[freq]}e-4" + get_value -v 'cpu[freq]' -sf "/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq" -i + printf -v 'cpu[freq]' "%.0f0" "${cpu[freq]}e-4" fi if ((${#cpu[freq]}>3)); then cpu[freq_string]="${cpu[freq]::-3}.${cpu[freq]:(-3):1} GHz" @@ -1389,13 +1389,13 @@ collect_cpu_temps() { #? Collect cpu temperatures sens_var="$(sensors)" #* Get CPU package temp - if get_value -v cpu[temp_0] -sv "sens_var" -k "Package*:" -mk 1; then + if get_value -v 'cpu[temp_0]' -sv "sens_var" -k "Package*:" -mk 1; then #* If successful get temperature unit, convert temp to integer and get high, crit and core temps cpu[temp_unit]=${cpu[temp_0]:(-2)}; cpu[temp_0]=${cpu[temp_0]%.*}; if [[ ${cpu[temp_0]::1} == "+" ]]; then cpu[temp_0]=${cpu[temp_0]#+}; fi if [[ -z ${cpu[temp_high]} ]]; then - get_value -v "cpu[temp_high]" -sv "sens_var" -k "Package*high =" -m 2 -r "[^0-9.]" -b -i - get_value -v "cpu[temp_crit]" -sv "sens_var" -k "Package*crit =" -m 2 -r "[^0-9.]" -b -i + get_value -v 'cpu[temp_high]' -sv "sens_var" -k "Package*high =" -m 2 -r "[^0-9.]" -b -i + get_value -v 'cpu[temp_crit]' -sv "sens_var" -k "Package*crit =" -m 2 -r "[^0-9.]" -b -i fi for((i=0,it=1;i0)); then - get_value -v swap[free] -sv "mem_info" -k "SwapFree:" -i + get_value -v 'swap[free]' -sv "mem_info" -k "SwapFree:" -i swap[free_percent]=$((swap[free]*100/swap[total])) swap[used]=$((swap[total]-swap[free])) @@ -2054,15 +2054,15 @@ draw_cpu() { #? Draw cpu and core graphs and print percentages done #* Print load average and uptime - if ((pt_line+y+1<=p_height)); then + if ((pt_line+y+3