From bca073bfce83371944dec1aa0ef8a259f577d3b8 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Fri, 1 May 2020 20:37:38 -0500 Subject: [PATCH 1/4] Translation file with help text. --- translations/en_US.toml | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 translations/en_US.toml diff --git a/translations/en_US.toml b/translations/en_US.toml new file mode 100644 index 0000000..05cde16 --- /dev/null +++ b/translations/en_US.toml @@ -0,0 +1,44 @@ +configfile="Config file" +usage="Usage: {0} [options]\n\nOptions:\n" + + +[help] +paths="Loadable colorschemes & layouts, and the config file, are searched for, in order:" +log="The log file is in {0}" +written="Config written to {0}" + + +[args] +help="Show this screen." +color="Set a colorscheme." +scale="Graph scale factor, >0" +version="Print version and exit." +percpu="Show each CPU in the CPU widget." +cpuavg="Show average CPU in the CPU widget." +temp="Show temperatures in fahrenheit.Show temperatures in fahrenheit." +statusbar="Show a statusbar with the time." +rate="Refresh frequency. Most time units accepted. \"1m\" = refresh every minute. \"100ms\" = refresh every 100ms." +layout="Name of layout spec file for the UI. Use \"-\" to pipe." +net="Select network interface. Several interfaces can be defined using comma separated values. Interfaces can also be ignored using \"!\"" +export="Enable metrics for export on the specified port." +mbps="Show network rate as mbps." +test="Runs tests and exits with success/failure code." +conffile="Config file to use instead of default (MUST BE FIRST ARGUMENT)" +list=""" +List + devices: Prints out device names for filterable widgets + layouts: Lists build-in layouts + colorschemes: Lists built-in colorschemes + paths: List out configuration file search paths + widgets: Widgets that can be used in a layout + keys: Show the keyboard bindings.""" +write="Write out a default config file." + + +[errors] +configparse="failed to parse config file: {0}" +cliparse="parsing CLI args: {0}" +logsetup="failed to setup log file: {0}" +unknownopt="Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="Failed to write configuration file: {0}" +checklog="errors encountered; from {0}:" From 91284adcf77cd6bfeee4b36973f39ef7734b287a Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Tue, 5 May 2020 08:18:35 -0500 Subject: [PATCH 2/4] Fixes #115; makes instructions more brief. --- README.md | 93 ++++++++++--------------------------------------------- 1 file changed, 16 insertions(+), 77 deletions(-) diff --git a/README.md b/README.md index fd37437..1880298 100644 --- a/README.md +++ b/README.md @@ -23,56 +23,25 @@ Working and tested on Linux, FreeBSD and MacOS. Windows binaries are provided, b If you install gotop by hand, or you download or create new layouts or colorschemes, you will need to put the layout files where gotop can find them. To see the list of directories gotop looks for files, run `gotop -h`. The first directory is always the directory from which gotop is run. -### Arch +- **Arch**: Install from AUR, e.g. `yay -S gotop-bin`. There is also `gotop` and `gotop-git` +- **Gentoo**: gotop is available on [guru](https://gitweb.gentoo.org/repo/proj/guru.git) overlay. + ```shell + sudo layman -a guru + sudo emerge gotop + ``` +- OSX: gotop is in *homebrew-core*. `brew install gotop`. Make sure to uninstall and untap any previous installations or taps. +- **Prebuilt binaries**: Binaries for most systems can be downloaded from [the github releases page](https://github.com/xxxserxxx/gotop/releases). RPM and DEB packages are also provided. +- **Source**: This requires Go >= 1.14. `go get -u github.com/xxxserxxx/gotop/cmd/gotop` -AUR contains entries for `gotop` and `gotop-bin`. `gotop-git` still points at the old, unmaintained, repository for the moment. +### Console Users Note -``` -yay -S gotop-bin -``` - -There is also a build-from-source package: - -``` -yay -S gotop -``` - -### Gentoo - -`gotop` is available on [guru](https://gitweb.gentoo.org/repo/proj/guru.git) overlay. It's currently required to add this overlay in order to install `gotop`: +gotop requires a font that has braille and block character Unicode code points; some distributions do not provide this. In the gotop repository is a `pcf` font that has these points, and setting this font may improve how gotop renders in your console. To use this, run these commands: ```shell -sudo layman -a guru -sudo emerge gotop +$ curl -O -L https://raw.githubusercontent.com/xxxserxxx/gotop/master/fonts/Lat15-VGA16-braille.psf +$ setfont Lat15-VGA16-braille.psf ``` -### OSX - -gotop can be installed with [Homebrew](https://brew.sh/); you'll need to tap the recipe. If you'd previously tapped cjbassi's recipe, you'll want to untap that first. The old version of gotop is also included in Homebrew's core library, and that will always be chosen before any taps, so you have to specify the tap specifically. - -``` -brew uninstall gotop # If previously installed -brew untap cjbassi/gotop # If previously tapped -brew tap xxxserxxx/gotop -brew install xxxserxxx/gotop/gotop -``` - -### Prebuilt binaries - -This doesn't require Go, is easy, and works across distributions. You have to manually upgrade the executable yourself, though, so using your distribution's package (if one is available) is a better approach. - -Visit [the releases page](https://github.com/xxxserxxx/gotop/releases) with your web browser and download the appropriate file for your OS and architecture. Unzip it (the archive contains a single file) and then move the resulting `gotop` binary into your `$PATH` somewhere. If you're on a Debian or Redhat derivative, you can download an `.rpm` or `.deb` and install that. - -### Source - -This requires Go, and at the moment, Go 1.14 specifically. - -```bash -go get -u github.com/xxxserxxx/gotop/cmd/gotop -``` - -If you don't have Go 1.14, you will want to follow the Building instructions in the next section. - ### Building This is the download & compile approach. @@ -90,44 +59,14 @@ Move `gotop` to somewhere in your `$PATH`. ## Usage -### Keybinds +Run with `-h` to get an extensive list of command line arguments. Many of these can be configured by creating a configuration file; see the next section for more information. Key bindings can be viewed while gotop is running by pressing the `?` key, or they can be printed out by using the `--list keys` command. -- Quit: `q` or `` -- Process navigation: - - `k` and ``: up - - `j` and ``: down - - ``: half page up - - ``: half page down - - ``: full page up - - ``: full page down - - `gg` and ``: jump to top - - `G` and ``: jump to bottom -- Process actions: - - ``: toggle process grouping - - `dd`: kill selected process or group of processes with SIGTERM - - `d3`: kill selected process or group of processes with SIGQUIT - - `d9`: kill selected process or group of processes with SIGKILL -- Process sorting - - `c`: CPU - - `m`: Mem - - `p`: PID -- Process filtering: - - `/`: start editing filter - - (while editing): - - `` accept filter - - `` and ``: clear filter -- CPU and Mem graph scaling: - - `h`: scale in - - `l`: scale out -- `?`: toggles keybind help menu -- `b`: toggles display of network traffic in mbps or TX (or RX) per second - -### Mouse +In addition to the key bindings, the mouse can be used to control the process list: - click to select process - mouse wheel to scroll through processes -### Config file +## Config file Most command-line settings can be persisted into a configuration file. The config file is named `gotop.conf` and can be located in several places. The first place gotop will look is in the current directory; after this, the locations depend on the OS and distribution. On Linux using XDG, for instance, the home location of `~/.config/gotop/gotop.conf` is the second location. The last location is a system-wide global location, such as `/etc/gotop/gotop.conf`. The `-h` help command will print out all of the locations, in order. Command-line options override values in any config files, and only the first config file found is loaded. From 292c4c1bf381016b6674db279cfd111e5368b572 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Tue, 5 May 2020 09:33:37 -0500 Subject: [PATCH 3/4] Homebrew update --- .github/workflows/release.yml | 7 +++++++ README.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6390f46..a90118a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,3 +29,10 @@ jobs: repository: xxxserxxx/gotop-linux event-type: my-release client-payload: '{"tag": "${{ steps.tag_name.outputs.tag }}"}' + + - name: Update and inform Homebrew + uses: dawidd6/action-homebrew-bump-formula@v3 + with: + token: ${{ secrets.homebrew }} + formula: gotop + revision: ${{ steps.tag_name.outputs.tag }} diff --git a/README.md b/README.md index 1880298..8a3e55e 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ If you install gotop by hand, or you download or create new layouts or colorsche sudo layman -a guru sudo emerge gotop ``` -- OSX: gotop is in *homebrew-core*. `brew install gotop`. Make sure to uninstall and untap any previous installations or taps. +- **OSX**: gotop is in *homebrew-core*. `brew install gotop`. Make sure to uninstall and untap any previous installations or taps. - **Prebuilt binaries**: Binaries for most systems can be downloaded from [the github releases page](https://github.com/xxxserxxx/gotop/releases). RPM and DEB packages are also provided. - **Source**: This requires Go >= 1.14. `go get -u github.com/xxxserxxx/gotop/cmd/gotop` From b0e1e9a20ad2c198b65df420aef5821c7be7208c Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Wed, 6 May 2020 20:00:13 -0500 Subject: [PATCH 4/4] FIXMEs --- devices/cpu_cpu.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/devices/cpu_cpu.go b/devices/cpu_cpu.go index 42eff2e..a959e32 100644 --- a/devices/cpu_cpu.go +++ b/devices/cpu_cpu.go @@ -7,6 +7,8 @@ import ( psCpu "github.com/shirou/gopsutil/cpu" ) +// FIXME: broken % under Linux. Doesn't reflect reality *at all*. +// FIXME: gotop CPU use high -- gopsutils again? Try rolling back. func init() { f := func(cpus map[string]int, iv time.Duration, l bool) map[string]error { cpuCount, err := psCpu.Counts(l)