Merge branch 'master' into contrib
						commit
						234220db33
					
				|  | @ -25,7 +25,9 @@ assignees: aristocratos | |||
| 
 | ||||
| **Info (please complete the following information):** | ||||
|  - Bashtop version: | ||||
|  - Linux distribution and version:  | ||||
|  - (Linux) Linux distribution and version: | ||||
|  - (Linux) Data collection type (/proc or psutil): | ||||
|  - (OSX/FreeBSD) Os release version: | ||||
|  - Terminal used: | ||||
|  - Font used: | ||||
|  - Bash version, "bash --version" (version 4.4 or above is required): | ||||
|  |  | |||
|  | @ -0,0 +1,9 @@ | |||
| [submodule "test/libs/bats"] | ||||
| 	path = test/libs/bats | ||||
| 	url = https://github.com/sstephenson/bats | ||||
| [submodule "test/libs/bats-assert"] | ||||
| 	path = test/libs/bats-assert | ||||
| 	url = https://github.com/ztombol/bats-assert | ||||
| [submodule "test/libs/bats-support"] | ||||
| 	path = test/libs/bats-support | ||||
| 	url = https://github.com/ztombol/bats-support | ||||
|  | @ -0,0 +1,9 @@ | |||
| # travis does not offer python container for OSX or Windows, not sure if we can get automated testing? | ||||
| os: linux | ||||
| language: python | ||||
| python: | ||||
|   - "3.6" | ||||
| dist: bionic | ||||
| install: | ||||
|   - pip install -r requirements.txt | ||||
| script: ./test.sh | ||||
							
								
								
									
										66
									
								
								CHANGELOG.md
								
								
								
								
							
							
						
						
									
										66
									
								
								CHANGELOG.md
								
								
								
								
							|  | @ -1,5 +1,71 @@ | |||
| # Changelog | ||||
| 
 | ||||
| ## v0.9.7 | ||||
| 
 | ||||
| * Changed: UTF-8 locale check, try to find UTF-8 for current language if LANG is set but not with "UTF-8" suffix | ||||
| 
 | ||||
| ## v0.9.6 | ||||
| 
 | ||||
| * Fixed: UTF-8 locale check | ||||
| 
 | ||||
| ## v0.9.5 | ||||
| 
 | ||||
| * Added: UTF-8 locale check and automatic LANG variable set if not UTF-8 | ||||
| * Fixed: Filter out zero sized disks and added some psutil error checks | ||||
| 
 | ||||
| ## v0.9.4 | ||||
| 
 | ||||
| * Fixed: Missing path for OSX df and correct swap usage reporting for OSX | ||||
| 
 | ||||
| ## v0.9.3 | ||||
| 
 | ||||
| * Fixed: Resizing problems in iTerm2 | ||||
| * Changed: Removed redundant error checking in print function for lower cpu usage | ||||
| * Fixed: Memory in OSX now shows active memory usage and /private/var/vm as swap memory | ||||
| * Fixed: Disks in OSX changed from using "GNU df" to "BSD df" for better compatibility | ||||
| 
 | ||||
| ## v0.9.2 | ||||
| 
 | ||||
| * Fixed: Correct prefixes for some missed GNU tools | ||||
| * Added: Startup progress screen | ||||
| * Changed: replaced tput commands with escape sequence commands | ||||
| 
 | ||||
| ## v0.9.1 | ||||
| 
 | ||||
| * Added: FreeBSD support with python3 psutil data collection | ||||
| * Added: Check for gnu tools on non Linux platforms | ||||
| * Fixed: Increased graph history to avoid cut off on high resolution graphs | ||||
| 
 | ||||
| ## v0.9.0 | ||||
| 
 | ||||
| * Added: Mac OS X support with python3 psutil data collection | ||||
| * Added: Ability to switch between all available network devices | ||||
| 
 | ||||
| ## v0.8.32 | ||||
| 
 | ||||
| * Fixed: Error in theme error checking corrupting default theme | ||||
| 
 | ||||
| ## v0.8.31 | ||||
| 
 | ||||
| * Fixed: Theme 2-color gradient generation | ||||
| * Fixed: Theme file error checking | ||||
| 
 | ||||
| ## v0.8.30 | ||||
| 
 | ||||
| * Fixed: Crash on missing net device | ||||
| 
 | ||||
| ## v0.8.29 | ||||
| 
 | ||||
| * Fixed: Cpu temperature colors not working when above high temp value | ||||
| * Fixed: Unescaped "\" in process list and indent fixes | ||||
| * Changed: Changes to net graph rescaling parameters | ||||
| 
 | ||||
| ## v0.8.28 | ||||
| 
 | ||||
| * Fixed: Ctrl-C and Ctrl-Z not registering after change to "dd" | ||||
| * Added: Option to switch to high resolution graphs | ||||
| * Added: Current peak value for download/upload graphs | ||||
| 
 | ||||
| ## v0.8.27 | ||||
| 
 | ||||
| * Fixed: Use value for "Inactive"+"MemFree" if "MemAvailable" is missing in /proc/meminfo | ||||
|  |  | |||
							
								
								
									
										127
									
								
								README.md
								
								
								
								
							
							
						
						
									
										127
									
								
								README.md
								
								
								
								
							|  | @ -1,9 +1,13 @@ | |||
| #  | ||||
| 
 | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
|  | ||||
| [](https://travis-ci.com/aristocratos/bashtop) | ||||
| [](https://paypal.me/aristocratos) | ||||
| [](https://github.com/sponsors/aristocratos) | ||||
| [](https://ko-fi.com/aristocratos) | ||||
|  | @ -16,8 +20,8 @@ | |||
| * [Themes](#themes) | ||||
| * [Upcoming](#upcoming) (Updated, Python port) | ||||
| * [Support and funding](#support-and-funding) | ||||
| * [Compatibility](#compatibility) | ||||
| * [Dependencies](#dependencies) | ||||
| * [Compatibility](#compatibility) (Updated, OSX and FreeBSD Support) | ||||
| * [Dependencies](#dependencies) (Updated) | ||||
| * [Screenshots](#screenshots) | ||||
| * [Installation](#installation) (Updated) | ||||
| * [Configurability](#configurability) | ||||
|  | @ -47,6 +51,8 @@ Resource monitor that shows usage and stats for processor, memory, disks, networ | |||
| * UI menu for changing all config file options. | ||||
| * Auto scaling graph for network usage. | ||||
| * Shows message in menu if new version is available | ||||
| * Shows current read and write speeds for disks | ||||
| * Multiple data collection methods which can be switched if running on Linux | ||||
| 
 | ||||
| ## Themes | ||||
| 
 | ||||
|  | @ -58,20 +64,18 @@ Let me know if you want to contribute with new themes. | |||
| 
 | ||||
| ## Upcoming | ||||
| 
 | ||||
| #### (Mac OSX and *BSD support) | ||||
| ~~Currently rewriting to use python3 [psutil](https://github.com/giampaolo/psutil) for data collection instead of linux specific tools. | ||||
| This will add python 3 and psutil as dependencies, but will make bashtop cross platform compatible.~~ | ||||
| 
 | ||||
| Currently rewriting to use python3 [psutil](https://github.com/giampaolo/psutil) for data collection instead of linux specific tools. | ||||
| This will add python 3 and psutil as dependencies, but will make bashtop cross platform compatible. | ||||
| ~~This will be integrated in to main version when done and add the possibility to switch between psutil and linux tools for users running linux.~~ | ||||
| 
 | ||||
| ~~This will be in a new branch called bashtop-psutil when I'm done with initial testing~~ | ||||
| Bashtop is now Mac OS X and FreeBSD compatible! | ||||
| 
 | ||||
| This will be integrated in to main version when done and add the possibility to switch between psutil and linux tools for users running linux. | ||||
| #### Python port | ||||
| 
 | ||||
| #### Update | ||||
| Work on a complete python port ~~will begin this summer~~ has begun. My aim is to keep it compatible with pypy3 for a lot of added efficiency. | ||||
| 
 | ||||
| Work on a complete python port will begin this summer. My aim is to keep it compatible with pypy3 for a lot of added efficiency. | ||||
| 
 | ||||
| Bash(py)top? | ||||
| PyPyTop? | ||||
| 
 | ||||
| ## Support and funding | ||||
| 
 | ||||
|  | @ -90,7 +94,14 @@ Any support is greatly appreciated! | |||
| 
 | ||||
| ## Compatibility | ||||
| 
 | ||||
| Should work on most modern linux distributions. | ||||
| Should work on most modern linux distributions, on Mac OS X and on FreeBSD. | ||||
| 
 | ||||
| Will not display correctly on the standard terminal on OSX! | ||||
| Recommended alternative [iTerm2](https://www.iterm2.com/) | ||||
| 
 | ||||
| Will also need to be run as superuser on OSX to display stats for processes not owned by user. | ||||
| 
 | ||||
| The disk io stats on OSX and FreeBSD shows iostats for all disks at the top instead of per disk. | ||||
| 
 | ||||
| For correct display, a terminal with support for: | ||||
| 
 | ||||
|  | @ -109,24 +120,38 @@ Dropbear seems to not be able to set correct locale. So if accessing bashtop ove | |||
| 
 | ||||
| ## Dependencies | ||||
| 
 | ||||
| ## Linux, OSX and FreeBSD | ||||
| 
 | ||||
| **[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/)** | ||||
| **[GNU coreutils](https://www.gnu.org/software/coreutils/)** | ||||
| 
 | ||||
| **[GNU Grep](https://www.gnu.org/software/grep/)** | ||||
| **[GNU sed](https://www.gnu.org/software/sed/)** | ||||
| 
 | ||||
| ## Linux using /proc for data collection | ||||
| 
 | ||||
| **[GNU grep](https://www.gnu.org/software/grep/)** | ||||
| 
 | ||||
| **[ps from procps-ng](https://gitlab.com/procps-ng/procps)** (v3.1.15 or later) | ||||
| 
 | ||||
| **[sed](https://www.gnu.org/software/sed/)** | ||||
| **[GNU awk](https://www.gnu.org/software/gawk/)** | ||||
| 
 | ||||
| **[awk](https://www.gnu.org/software/gawk/)** | ||||
| ## OSX and FreeBSD or Linux using psutil for data collection | ||||
| 
 | ||||
| (Optional) **[lm-sensors](https://github.com/lm-sensors/lm-sensors)** Needed to show CPU temperatures | ||||
| **[Python3](https://www.python.org/downloads/)** (v3.6 or later) | ||||
| 
 | ||||
| (Optional) **[curl](https://curl.haxx.se/download.html)** (v7.16.2 or later) Needed if you want messages about updates and the ability to download themes. | ||||
| **[psutil python module](https://github.com/giampaolo/psutil)** | ||||
| 
 | ||||
| (Optional) **[iostat (part of sysstat)](https://github.com/sysstat/sysstat)** Needed if you want disk read/write stats | ||||
| ## Optionals for additional stats | ||||
| 
 | ||||
| (Optional OSX) **[osx-cpu-temp](https://github.com/lavoiesl/osx-cpu-temp)** Needed to show CPU temperatures. | ||||
| 
 | ||||
| (Optional Linux) **[lm-sensors](https://github.com/lm-sensors/lm-sensors)** Needed to show CPU temperatures. | ||||
| 
 | ||||
| (Optional Linux) **[iostat (part of sysstat)](https://github.com/sysstat/sysstat)** Needed if you want disk read/write stats and are not using psutil data collection. | ||||
| 
 | ||||
| (Optional OSX/Linux/FreeBSD) **[curl](https://curl.haxx.se/download.html)** (v7.16.2 or later) Needed if you want messages about updates and the ability to download themes. | ||||
| 
 | ||||
| ## Screenshots | ||||
| 
 | ||||
|  | @ -141,27 +166,58 @@ Options menu. | |||
| 
 | ||||
| ## Installation | ||||
| 
 | ||||
| #### Manual installation | ||||
| #### Dependencies installation OSX | ||||
| 
 | ||||
| Copy or link "bashtop" into PATH, or install with Makefile: | ||||
| 
 | ||||
| >From cloned directory | ||||
| >Install homebrew if not already installed | ||||
| 
 | ||||
| ``` bash | ||||
|  sudo make install | ||||
| /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||||
| ``` | ||||
| 
 | ||||
| >Install dependencies | ||||
| 
 | ||||
| ``` bash | ||||
| brew install bash coreutils gnu-sed python3 git | ||||
| pip3 install psutil | ||||
| ``` | ||||
| 
 | ||||
| >Install optional dependency osx-cpu-temp | ||||
| 
 | ||||
| ``` bash | ||||
| brew install osx-cpu-temp | ||||
| ``` | ||||
| 
 | ||||
| #### Dependencies installation FreeBSD | ||||
| 
 | ||||
| >Install with pkg and pip | ||||
| 
 | ||||
| ``` bash | ||||
| sudo pkg install coreutils gsed python3 git | ||||
| sudo python3 -m ensurepip | ||||
| sudo pip3 install psutil | ||||
| ``` | ||||
| 
 | ||||
| #### Manual installation Linux, OSX and FreeBSD | ||||
| 
 | ||||
| >Clone and install | ||||
| 
 | ||||
| ``` bash | ||||
| git clone https://github.com/aristocratos/bashtop.git | ||||
| cd bashtop | ||||
| sudo make install | ||||
| ``` | ||||
| 
 | ||||
| >to uninstall it | ||||
| 
 | ||||
| ``` bash | ||||
|  sudo make uninstall | ||||
| sudo make uninstall | ||||
| ``` | ||||
| 
 | ||||
| #### Arch based | ||||
| 
 | ||||
| Available in the AUR as [bashtop-git](https://aur.archlinux.org/packages/bashtop-git/) | ||||
| 
 | ||||
| Available in the Arch Linux repository as [bashtop](https://www.archlinux.org/packages/community/any/bashtop/) (Flagged out-of-date on 2020-04-28) | ||||
| Available in the Arch Linux repository as [bashtop](https://www.archlinux.org/packages/community/any/bashtop/) | ||||
| 
 | ||||
| #### Debian based | ||||
| 
 | ||||
|  | @ -233,7 +289,7 @@ Config files stored in "$HOME/.config/bashtop" folder | |||
| #### bashtop.cfg: (auto generated if not found) | ||||
| 
 | ||||
| ```bash | ||||
| #? Config file for bashtop v. 0.8.22 | ||||
| #? Config file for bashtop v. 0.9.0 | ||||
| 
 | ||||
| #* Color theme, looks for a .theme file in "$HOME/.config/bashtop/themes", "Default" for builtin default theme | ||||
| color_theme="Default" | ||||
|  | @ -248,7 +304,7 @@ proc_sorting="cpu lazy" | |||
| #* Reverse sorting order, "true" or "false" | ||||
| proc_reversed="false" | ||||
| 
 | ||||
| #* Check cpu temperature, only works if "sensors" command is available and have values for "Package" and "Core" | ||||
| #* Check cpu temperature, only works if "sensors", "vcgencmd" or "osx-cpu-temp" commands is available | ||||
| check_temp="true" | ||||
| 
 | ||||
| #* Draw a clock at top of screen, formatting according to strftime, empty string to disable | ||||
|  | @ -271,6 +327,15 @@ proc_per_core="false" | |||
| 
 | ||||
| #* Optional filter for shown disks, should be names of mountpoints, "root" replaces "/", separate multiple values with space | ||||
| disks_filter="" | ||||
| 
 | ||||
| #* Enable check for new version from github.com/aristocratos/bashtop at start | ||||
| update_check="true" | ||||
| 
 | ||||
| #* Enable graphs with double the horizontal resolution, increases cpu usage | ||||
| hires_graphs="false" | ||||
| 
 | ||||
| #* Enable the use of psutil python3 module for data collection, default on OSX | ||||
| use_psutil="true" | ||||
| ``` | ||||
| 
 | ||||
| #### Command line options: (not yet implemented) | ||||
|  | @ -285,7 +350,7 @@ USAGE: bashtop | |||
| Might finish off items out of order since I usually work on multiple at a time. | ||||
| 
 | ||||
| - [x] Add options to change colors for text, graphs and meters. | ||||
| - [ ] Fix cross platform compatibility for Mac OSX and *BSD: Currently in testing. | ||||
| - [x] Fix cross platform compatibility for Mac OSX and *BSD: Working on OSX, and FreeBSD. | ||||
| - [x] Add support for showing AMD cpu temperatures. | ||||
| - [x] Add option to show tree view of processes. | ||||
| - [x] Add option to reset network download/upload totals. | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
| psutil==5.7.0 | ||||
|  | @ -0,0 +1,3 @@ | |||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| ./test/libs/bats/bin/bats test/*.bats | ||||
|  | @ -0,0 +1,17 @@ | |||
| #!/usr/bin/env bats | ||||
| 
 | ||||
| load 'libs/bats-support/load' | ||||
| load 'libs/bats-assert/load' | ||||
| 
 | ||||
| load test_helper | ||||
| 
 | ||||
| @test "Sourcing works, by checking if \$system is set" { | ||||
|     run echo $system | ||||
|     refute_output "" | ||||
| } | ||||
| 
 | ||||
| @test "#get_themes populates themes" { | ||||
|   get_themes | ||||
|   assert_success | ||||
|   assert [ ${#themes[@]} -gt 0 ] | ||||
| } | ||||
|  | @ -0,0 +1 @@ | |||
| Subproject commit 03608115df2071fff4eaaff1605768c275e5f81f | ||||
|  | @ -0,0 +1 @@ | |||
| Subproject commit 9f88b4207da750093baabc4e3f41bf68f0dd3630 | ||||
|  | @ -0,0 +1 @@ | |||
| Subproject commit 004e707638eedd62e0481e8cdc9223ad471f12ee | ||||
|  | @ -0,0 +1 @@ | |||
| source bashtop | ||||
|  | @ -3,6 +3,7 @@ flat-remix-light.theme | |||
| flat-remix.theme | ||||
| greyscale.theme | ||||
| gruvbox_dark.theme | ||||
| monokai_mod.theme | ||||
| monokai_nobg.theme | ||||
| monokai.theme | ||||
| solarized_dark.theme | ||||
|  |  | |||
|  | @ -0,0 +1,89 @@ | |||
| #Bashtop monokai mod theme | ||||
| #by aristocratos | ||||
| 
 | ||||
| # Colors should be in 6 or 2 character hexadecimal or single spaced rgb decimal: "#RRGGBB", "#BW" or "0-255 0-255 0-255" | ||||
| # example for white: "#FFFFFF", "#ff" or "255 255 255". | ||||
| 
 | ||||
| # All graphs and meters can be gradients | ||||
| # For single color graphs leave "mid" and "end" variable empty. | ||||
| # Use "start" and "end" variables for two color gradient | ||||
| # Use "start", "mid" and "end" for three color gradient | ||||
| 
 | ||||
| # Main background, empty for terminal default, need to be empty if you want transparent background | ||||
| theme[main_bg]="" | ||||
| 
 | ||||
| # Main text color | ||||
| theme[main_fg]="#F8F8F2" | ||||
| 
 | ||||
| # Title color for boxes | ||||
| theme[title]="#F8F8F2" | ||||
| 
 | ||||
| # Higlight color for keyboard shortcuts | ||||
| theme[hi_fg]="#F92672" | ||||
| 
 | ||||
| # Background color of selected item in processes box | ||||
| theme[selected_bg]="#7a1137"  | ||||
| 
 | ||||
| # Foreground color of selected item in processes box | ||||
| theme[selected_fg]="#F8F8F2" | ||||
| 
 | ||||
| # Color of inactive/disabled text | ||||
| theme[inactive_fg]="#595647" | ||||
| 
 | ||||
| # Misc colors for processes box including mini cpu graphs, details memory graph and details status text | ||||
| theme[proc_misc]="#A6E22E" | ||||
| 
 | ||||
| # Cpu box outline color | ||||
| theme[cpu_box]="#75715E" | ||||
| 
 | ||||
| # Memory/disks box outline color | ||||
| theme[mem_box]="#75715E" | ||||
| 
 | ||||
| # Net up/down box outline color | ||||
| theme[net_box]="#75715E" | ||||
| 
 | ||||
| # Processes box outline color | ||||
| theme[proc_box]="#75715E" | ||||
| 
 | ||||
| # Box divider line and small boxes line color | ||||
| theme[div_line]="#595647" | ||||
| 
 | ||||
| # Temperature graph colors | ||||
| theme[temp_start]="#7976B7" | ||||
| theme[temp_mid]="#D8B8B2" | ||||
| theme[temp_end]="#F92672" | ||||
| 
 | ||||
| # CPU graph colors | ||||
| theme[cpu_start]="#A6E22E" | ||||
| theme[cpu_mid]="#F8F8F2" #b05475" | ||||
| theme[cpu_end]="#F92672" | ||||
| 
 | ||||
| # Mem/Disk free meter | ||||
| theme[free_start]="#75715E" | ||||
| theme[free_mid]="a9c474" | ||||
| theme[free_end]="#e2f5bc" | ||||
| 
 | ||||
| # Mem/Disk cached meter | ||||
| theme[cached_start]="#75715E" | ||||
| theme[cached_mid]="#66D9EF" | ||||
| theme[cached_end]="#aae7f2" | ||||
| 
 | ||||
| # Mem/Disk available meter | ||||
| theme[available_start]="#75715E" | ||||
| theme[available_mid]="#E6DB74" | ||||
| theme[available_end]="#f2ecb6" | ||||
| 
 | ||||
| # Mem/Disk used meter | ||||
| theme[used_start]="#75715E" | ||||
| theme[used_mid]="#F92672" | ||||
| theme[used_end]="#ff87b2" | ||||
| 
 | ||||
| # Download graph colors | ||||
| theme[download_start]="#2d2042" | ||||
| theme[download_mid]="#7352a8" | ||||
| theme[download_end]="#ccaefc" | ||||
| 
 | ||||
| # Upload graph colors | ||||
| theme[upload_start]="#570d33" | ||||
| theme[upload_mid]="#cf277d" | ||||
| theme[upload_end]="#fa91c7" | ||||
		Loading…
	
		Reference in New Issue
	
	 Umar
						Umar