From e5bf9851ff3fc8748a2c770415a13a7a0244ba55 Mon Sep 17 00:00:00 2001 From: "Sean E. Russell" Date: Wed, 3 Feb 2021 14:27:46 -0600 Subject: Go 1.16: embed and io/fs --- README.md | 33 +++- cmd/gotop/main.go | 24 ++- colorschemes/registry.go | 2 +- config.go | 6 +- devices/data/smc.tsv | 162 ---------------- devices/devices.go | 2 +- devices/smc.go | 245 ------------------------ devices/smc.tsv | 162 ++++++++++++++++ devices/temp_darwin.go | 15 +- devices/temp_darwin_test.go | 23 +++ dicts/de_DE.toml | 182 ++++++++++++++++++ dicts/en_US.toml | 183 ++++++++++++++++++ dicts/eo.toml | 184 ++++++++++++++++++ dicts/tt_TT.toml | 181 ++++++++++++++++++ dicts/zh_CN.toml | 182 ++++++++++++++++++ go.mod | 7 +- go.sum | 28 +-- layout/layout.go | 2 +- logging/logging.go | 2 +- termui/table.go | 2 +- translations/dicts.go | 425 ------------------------------------------ translations/dicts/de_DE.toml | 182 ------------------ translations/dicts/en_US.toml | 183 ------------------ translations/dicts/eo.toml | 184 ------------------ translations/dicts/tt_TT.toml | 181 ------------------ translations/dicts/zh_CN.toml | 182 ------------------ widgets/help.go | 2 +- 27 files changed, 1165 insertions(+), 1801 deletions(-) delete mode 100644 devices/data/smc.tsv delete mode 100644 devices/smc.go create mode 100644 devices/smc.tsv create mode 100644 dicts/de_DE.toml create mode 100644 dicts/en_US.toml create mode 100644 dicts/eo.toml create mode 100644 dicts/tt_TT.toml create mode 100644 dicts/zh_CN.toml delete mode 100644 translations/dicts.go delete mode 100644 translations/dicts/de_DE.toml delete mode 100644 translations/dicts/en_US.toml delete mode 100644 translations/dicts/eo.toml delete mode 100644 translations/dicts/tt_TT.toml delete mode 100644 translations/dicts/zh_CN.toml diff --git a/README.md b/README.md index b929e95..ccd7f21 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,10 @@ If you install gotop by hand, or you download or create new layouts or colorsche ``` - **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` +- **Prebuild binaries with extensions**: + - [NVidia GPU support](https://github.com/xxxserxxx/gotop-nvidia/releases) + - [Remote gotop support](https://github.com/xxxserxxx/gotop-remote/releases) +- **Source**: This requires Go >= 1.16. `go get -u github.com/xxxserxxx/gotop/cmd/gotop` ### Extension builds @@ -43,6 +46,12 @@ An evolving mechanism in gotop are extensions. This is designed to allow gotop t The path to these extensions is a tool called [gotop-builder](https://github.com/xxxserxxx/gotop-builder). It is easy to use and depends only on having Go installed. You can read more about it on the project page, where you can also find binaries for Linux that have *all* extensions built in. If you want less than an all-inclusive build, or one for a different OS/architecture, you can use gotop-builder itself to create your own. +There are currently two extensions: + +- Support for [NVidia GPUs](https://github.com/xxxserxxx/gotop-nvidia), which add GPU usage, memory, and temperature data to the respective widgets +- Support for [remote devices](https://github.com/xxxserxxx/gotop-remote), which allows running gotop on a remote machine and seeing the sensors from that as if they were local sensors. + +There are builds for those binaries for Linux in each of the repositories. ### Console Users @@ -57,12 +66,12 @@ setfont Lat15-VGA16-braille.psf This is the download & compile approach. -gotop should build with most versions of Go. If you have a version other than 1.14 installed, remove the `go` line at the end of `go.mod` and it should work. +gotop requires Go 1.16 or later to build, as it relies on the embed feature released with 1.16; a library it uses, lingo, uses both embed and the `io/fs` package. For a version of gotop that builds with earlier versions, check out one of the tags prior to v4.2.0. ```shell git clone https://github.com/xxxserxxx/gotop.git cd gotop -sed -i '/^go/d' go.mod # Do this if you have go != 1.14 +# This ugly SOB gets a usable version from the git tag list VERS="$(git tag -l --sort=-v:refname | sed 's/v\([^-].*\)/\1/g' | head -1 | tr -d '-' ).$(git describe --long --tags | sed 's/\([^-].*\)-\([0-9]*\)-\(g.*\)/r\2.\3/g' | tr -d '-')" DAT=$(date +%Y%m%dT%H%M%S) go build -o gotop \ @@ -70,13 +79,19 @@ go build -o gotop \ ./cmd/gotop ``` -Move `gotop` to somewhere in your `$PATH`. +If you want to compact the executable as much as possible on Linux, change the `ldflags` line to this: + +``` +-ldflags "-X main.Version=v${VERS} -X main.BuildDate=${DAT} -extldflags '-s -w'" \ +``` + +Now move the `gotop` executable to somewhere in your `$PATH`. If Go is not installed or is the wrong version, and you don't have root access or don't want to upgrade Go, a script is provided to download Go and the gotop sources, compile gotop, and then clean up. See `scripts/install_without_root.sh`. #### go generate -Apple SMC tags are embedded in a text file that is compiled into the executable; the same happens with the language translations. When the file `devices/data/sm.tsv` or any translations in `translations/dicts/` change, `go generate` should be re-run. +With Go 1.16, it is no longer necessary to call `go generate`. Translations and Apple SMC tags are emded with `go:embed`. ## Usage @@ -119,7 +134,8 @@ For more information on other topics, see: - [goreleaser/nfpm](https://github.com/goreleaser/nfpm) - [distatus/battery](https://github.com/distatus/battery) - [VictoriaMetrics/metrics](https://github.com/VictoriaMetrics/metrics) Check this out! The API is clean, elegant, introduces many fewer indirect dependencies than the Prometheus client, and adds 50% less size to binaries. -- [lingo-toml](https://github.com/jdkeke142/lingo-toml) provides the translation support library. +- [lingo](https://github.com/xxxserxxx/lingo) is forked from [jdkeke142's](https://github.com/jdkeke142/lingo-toml) lingo, which was in turn forked from [kortemy's](https://github.com/kortemy/lingo) original project. + ## History @@ -130,12 +146,13 @@ For more information on other topics, see: I obviously think gotop is the Bee's Knees, but there are many alternatives. Many of these have been around for years. All of them are terminal-based tools. - Grandpa [top](http://sourceforge.net/projects/unixtop/). Written 36 years ago, C, installed by default on almost every Unix descendant. +- [bashtop](https://github.com/aristocratos/bashtop), in pure bash! Beautiful and space efficient, and [deserves special comment](docs/bashtop.md). +- [bpytop](https://github.com/aristocratos/bpytop), aristocratos, the author of bashtop, rewrote it in Python in mid-2020; it's the same beautiful interface, and a very nice alternative. - [htop](https://hisham.hm/htop/). A prettier top. Similar functionality. 16 years old! - [atop](https://www.atoptool.nl/). Detailed process-focused inspection with a table-like view. Been around for 9 long years. - [iftop](http://www.ex-parrot.com/~pdw/iftop/), a top for network connections. More than just data transfer, iftop will show what interfaces are connecting to what IP addresses. Requires root access to run. - [iotop](http://guichaz.free.fr/iotop/), top for disk access. Tells you *which* processes are writing to and from disk space, and how much. Also requires root access to run. - [nmon](http://nmon.sourceforge.net) a dashboard style top; widgets can be dynamically enabled and disabled, pure ASCII rendering, so it doesn't rely on fancy character sets to draw bars. -- [bashtop](https://github.com/aristocratos/bashtop), in pure bash! Beautiful and space efficient, and [deserves special comment](docs/bashtop.md). If you use anything other than gotop, I'd recommend bashtop. - [ytop](https://github.com/cjbassi/ytop), a rewrite of gotop (ca. 3.0) in Rust. Same great UI, different programming language. - [slabtop](https://gitlab.com/procps-ng/procps), part of procps-ng, looks like top but provides kernel slab cache information! Requires root. - [systemd-cgtop](https://www.github.com/systemd/systemd), comes with systemd (odds are your system uses systemd, so this is already installed), provides a resource use view of control groups -- basically, which services are using what resources. Does *not* require root to run. @@ -145,7 +162,7 @@ I obviously think gotop is the Bee's Knees, but there are many alternatives. Man ### A comment on clones -In a chat room I heard someone refer to gotop as "another one of those fancy language rewrites people do." I'm not the original author of gotop, so it's easy to not take offense, but I'm going on record as saying that I disagree with that sentiment: I think these rewrites are valuable, useful, and healthy to the community. They increase software diversity at very little [cost to users](https://en.wikipedia.org/wiki/Information_overload), and are a sort of evolutionary mechanism: as people do rewrites, some are worse, but some are better, and users benefit. Rewrites provide options, which fight against [monocultures](https://github.com). As importantly, most developers are really only fluent in a couple of programming languages. We all have *familiarity* with a dozen, and may even have extensive experience with a half-dozen, but if you don't constantly use a language, you tend to forget the extended library APIs, your development environment isn't tuned, you're rusty with using the tool sets, and you may have forgotten a lot of the language peculiarities and gotchas. The barrier to entry for contributing to a software project -- to simply finding and fixing a bug -- in a language you're not intimate with can be very high. It gets much worse if the project owner is a stickler for quality and style. So I believe that gotop's original author's decision to rewrite his project in Rust is a net positive. He probably made fewer design mistakes in ytop (we always do, on the second rewrite), and Rust developers -- who may have hesitated learning or brushing up on Go to submit an improvement -- have another project to which they can contribute. +In a chat room I heard someone refer to gotop as "another one of those fancy language rewrites people do." I'm not the original author of gotop, so it's easy to not take offense, but I'm going on record as saying that I disagree with that sentiment: I think these rewrites are valuable, useful, and healthy to the community. They increase software diversity at very little [cost to users](https://en.wikipedia.org/wiki/Information_overload), and are a sort of evolutionary mechanism: as people do rewrites, some are worse, but some are better, and users benefit. Rewrites provide options, which fight against [monocultures](https://github.com). As importantly, most developers are really only fluent in a couple of programming languages. We all have *familiarity* with a dozen, and may even have extensive experience with a half-dozen, but if you don't constantly use a language, you tend to forget the extended library APIs, your development environment isn't tuned, you're rusty with using the tool sets, and you may have forgotten a lot of the language peculiarities and gotchas. The barrier to entry for contributing to a software project -- to simply finding and fixing a bug -- in a language you're not intimate with can be very high. It gets much worse if the project owner is a stickler for a particular style. So I believe that gotop's original author's decision to rewrite his project in Rust is a net positive. He probably made fewer design mistakes in ytop (we always do, on the second rewrite), and Rust developers -- who may have hesitated learning or brushing up on Go to submit an improvement -- have another project to which they can contribute. Diversity is good. Don't knock the free stuff. diff --git a/cmd/gotop/main.go b/cmd/gotop/main.go index c021515..4a8416f 100644 --- a/cmd/gotop/main.go +++ b/cmd/gotop/main.go @@ -5,6 +5,7 @@ import ( "flag" "fmt" "io" + "io/fs" "io/ioutil" "log" "net/http" @@ -21,8 +22,8 @@ import ( "github.com/VictoriaMetrics/metrics" jj "github.com/cloudfoundry-attic/jibber_jabber" ui "github.com/gizak/termui/v3" - "github.com/xxxserxxx/lingo" "github.com/shibukawa/configdir" + "github.com/xxxserxxx/lingo/v2" "github.com/xxxserxxx/opflag" "github.com/xxxserxxx/gotop/v4" @@ -30,7 +31,6 @@ import ( "github.com/xxxserxxx/gotop/v4/devices" "github.com/xxxserxxx/gotop/v4/layout" "github.com/xxxserxxx/gotop/v4/logging" - "github.com/xxxserxxx/gotop/v4/translations" w "github.com/xxxserxxx/gotop/v4/widgets" ) @@ -125,14 +125,22 @@ func parseArgs() error { case "widgets": fmt.Println(tr.Value("help.widgets")) case "langs": - vs, err := translations.AssetDir("") + err := fs.WalkDir(gotop.Dicts, ".", func(pth string, info fs.DirEntry, err error) error { + if err != nil { + return err + } + if info.IsDir() { // We skip these + return nil + } + fileName := info.Name() + if !strings.HasSuffix(fileName, ".toml") { + fmt.Println(strings.TrimSuffix(fileName, ".toml")) + } + return nil + }) if err != nil { return err } - for _, v := range vs { - v = strings.TrimSuffix(v, ".toml") - fmt.Println(v) - } default: fmt.Printf(tr.Value("error.unknownopt", *list)) os.Exit(1) @@ -362,7 +370,7 @@ func main() { } func run() int { - ling, err := lingo.New("en_US", "", translations.AssetFile()) + ling, err := lingo.New("en_US", ".", gotop.Dicts) if err != nil { fmt.Printf("failed to load language files: %s\n", err) return 2 diff --git a/colorschemes/registry.go b/colorschemes/registry.go index aa6e1f9..663ccab 100644 --- a/colorschemes/registry.go +++ b/colorschemes/registry.go @@ -6,7 +6,7 @@ import ( "path/filepath" "strings" - "github.com/xxxserxxx/lingo" + "github.com/xxxserxxx/lingo/v2" "github.com/shibukawa/configdir" ) diff --git a/config.go b/config.go index b483f65..68ec523 100644 --- a/config.go +++ b/config.go @@ -6,6 +6,7 @@ package gotop import ( "bufio" "bytes" + "embed" "fmt" "io" "io/ioutil" @@ -16,12 +17,15 @@ import ( "strings" "time" - "github.com/xxxserxxx/lingo" "github.com/shibukawa/configdir" "github.com/xxxserxxx/gotop/v4/colorschemes" "github.com/xxxserxxx/gotop/v4/widgets" + "github.com/xxxserxxx/lingo/v2" ) +//go:embed "dicts/*.toml" +var Dicts embed.FS + // CONFFILE is the name of the default config file const CONFFILE = "gotop.conf" diff --git a/devices/data/smc.tsv b/devices/data/smc.tsv deleted file mode 100644 index f6ff37b..0000000 --- a/devices/data/smc.tsv +++ /dev/null @@ -1,162 +0,0 @@ -"TCXC" "PECI CPU" -"TCXc" "PECI CPU" -"TC0P" "CPU 1 Proximity" -"TC0H" "CPU 1 Heatsink" -"TC0D" "CPU 1 Package" -"TC0E" "CPU 1" -"TC0F" "CPU 1" -"TC1C" "CPU Core 1" -"TC2C" "CPU Core 2" -"TC3C" "CPU Core 3" -"TC4C" "CPU Core 4" -"TC5C" "CPU Core 5" -"TC6C" "CPU Core 6" -"TC7C" "CPU Core 7" -"TC8C" "CPU Core 8" -"TCAH" "CPU 1 Heatsink Alt." -"TCAD" "CPU 1 Package Alt." -"TC1P" "CPU 2 Proximity" -"TC1H" "CPU 2 Heatsink" -"TC1D" "CPU 2 Package" -"TC1E" "CPU 2" -"TC1F" "CPU 2" -"TCBH" "CPU 2 Heatsink Alt." -"TCBD" "CPU 2 Package Alt." -"TCSC" "PECI SA" -"TCSc" "PECI SA" -"TCSA" "PECI SA" -"TCGC" "PECI GPU" -"TCGc" "PECI GPU" -"TG0P" "GPU Proximity" -"TG0D" "GPU Die" -"TG1D" "GPU Die" -"TG0H" "GPU Heatsink" -"TG1H" "GPU Heatsink" -"Ts0S" "Memory Proximity" -"TM0P" "Mem Bank A1" -"TM1P" "Mem Bank A2" -"TM8P" "Mem Bank B1" -"TM9P" "Mem Bank B2" -"TM0S" "Mem Module A1" -"TM1S" "Mem Module A2" -"TM8S" "Mem Module B1" -"TM9S" "Mem Module B2" -"TN0D" "Northbridge Die" -"TN0P" "Northbridge Proximity 1" -"TN1P" "Northbridge Proximity 2" -"TN0C" "MCH Die" -"TN0H" "MCH Heatsink" -"TP0D" "PCH Die" -"TPCD" "PCH Die" -"TP0P" "PCH Proximity" -"TA0P" "Airflow 1" -"TA1P" "Airflow 2" -"Th0H" "Heatpipe 1" -"Th1H" "Heatpipe 2" -"Th2H" "Heatpipe 3" -"Tm0P" "Mainboard Proximity" -"Tp0P" "Powerboard Proximity" -"Ts0P" "Palm Rest" -"Tb0P" "BLC Proximity" -"TL0P" "LCD Proximity" -"TW0P" "Airport Proximity" -"TH0P" "HDD Bay 1" -"TH1P" "HDD Bay 2" -"TH2P" "HDD Bay 3" -"TH3P" "HDD Bay 4" -"TO0P" "Optical Drive" -"TB0T" "Battery TS_MAX" -"TB1T" "Battery 1" -"TB2T" "Battery 2" -"TB3T" "Battery" -"Tp0P" "Power Supply 1" -"Tp0C" "Power Supply 1 Alt." -"Tp1P" "Power Supply 2" -"Tp1C" "Power Supply 2 Alt." -"Tp2P" "Power Supply 3" -"Tp3P" "Power Supply 4" -"Tp4P" "Power Supply 5" -"Tp5P" "Power Supply 6" -"TS0C" "Expansion Slots" -"TA0S" "PCI Slot 1 Pos 1" -"TA1S" "PCI Slot 1 Pos 2" -"TA2S" "PCI Slot 2 Pos 1" -"TA3S" "PCI Slot 2 Pos 2" -"VC0C" "CPU Core 1" -"VC1C" "CPU Core 2" -"VC2C" "CPU Core 3" -"VC3C" "CPU Core 4" -"VC4C" "CPU Core 5" -"VC5C" "CPU Core 6" -"VC6C" "CPU Core 7" -"VC7C" "CPU Core 8" -"VV1R" "CPU VTT" -"VG0C" "GPU Core" -"VM0R" "Memory" -"VN1R" "PCH" -"VN0C" "MCH" -"VD0R" "Mainboard S0 Rail" -"VD5R" "Mainboard S5 Rail" -"VP0R" "12V Rail" -"Vp0C" "12V Vcc" -"VV2S" "Main 3V" -"VR3R" "Main 3.3V" -"VV1S" "Main 5V" -"VH05" "Main 5V" -"VV9S" "Main 12V" -"VD2R" "Main 12V" -"VV7S" "Auxiliary 3V" -"VV3S" "Standby 3V" -"VV8S" "Standby 5V" -"VeES" "PCIe 12V" -"VBAT" "Battery" -"Vb0R" "CMOS Battery" -"IC0C" "CPU Core" -"IC1C" "CPU VccIO" -"IC2C" "CPU VccSA" -"IC0R" "CPU Rail" -"IC5R" "CPU DRAM" -"IC8R" "CPU PLL" -"IC0G" "CPU GFX" -"IC0M" "CPU Memory" -"IG0C" "GPU Rail" -"IM0C" "Memory Controller" -"IM0R" "Memory Rail" -"IN0C" "MCH" -"ID0R" "Mainboard S0 Rail" -"ID5R" "Mainboard S5 Rail" -"IO0R" "Misc. Rail" -"IB0R" "Battery Rail" -"IPBR" "Charger BMON" -"PC0C" "CPU Core 1" -"PC1C" "CPU Core 2" -"PC2C" "CPU Core 3" -"PC3C" "CPU Core 4" -"PC4C" "CPU Core 5" -"PC5C" "CPU Core 6" -"PC6C" "CPU Core 7" -"PC7C" "CPU Core 8" -"PCPC" "CPU Cores" -"PCPG" "CPU GFX" -"PCPD" "CPU DRAM" -"PCTR" "CPU Total" -"PCPL" "CPU Total" -"PC1R" "CPU Rail" -"PC5R" "CPU S0 Rail" -"PGTR" "GPU Total" -"PG0R" "GPU Rail" -"PM0R" "Memory Rail" -"PN0C" "MCH" -"PN1R" "PCH Rail" -"PC0R" "Mainboard S0 Rail" -"PD0R" "Mainboard S0 Rail" -"PD5R" "Mainboard S5 Rail" -"PH02" "Main 3.3V Rail" -"PH05" "Main 5V Rail" -"Pp0R" "12V Rail" -"PD2R" "Main 12V Rail" -"PO0R" "Misc. Rail" -"PBLC" "Battery Rail" -"PB0R" "Battery Rail" -"PDTR" "DC In Total" -"PSTR" "System Total" diff --git a/devices/devices.go b/devices/devices.go index 1574354..f9c6265 100644 --- a/devices/devices.go +++ b/devices/devices.go @@ -2,7 +2,7 @@ package devices import ( "log" - "github.com/xxxserxxx/lingo" + "github.com/xxxserxxx/lingo/v2" ) const ( diff --git a/devices/smc.go b/devices/smc.go deleted file mode 100644 index dfcd1ac..0000000 --- a/devices/smc.go +++ /dev/null @@ -1,245 +0,0 @@ -// Code generated by go-bindata. (@generated) DO NOT EDIT. - - //Package devices generated by go-bindata.// sources: -// devices/data/smc.tsv -package devices - -import ( - "bytes" - "compress/gzip" - "fmt" - "io" - "io/ioutil" - "os" - "path/filepath" - "strings" - "time" -) - -func bindataRead(data []byte, name string) ([]byte, error) { - gz, err := gzip.NewReader(bytes.NewBuffer(data)) - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - - var buf bytes.Buffer - _, err = io.Copy(&buf, gz) - clErr := gz.Close() - - if err != nil { - return nil, fmt.Errorf("read %q: %v", name, err) - } - if clErr != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -type asset struct { - bytes []byte - info os.FileInfo -} - -type bindataFileInfo struct { - name string - size int64 - mode os.FileMode - modTime time.Time -} - -// Name return file name -func (fi bindataFileInfo) Name() string { - return fi.name -} - -// Size return file size -func (fi bindataFileInfo) Size() int64 { - return fi.size -} - -// Mode return file mode -func (fi bindataFileInfo) Mode() os.FileMode { - return fi.mode -} - -// ModTime return file modify time -func (fi bindataFileInfo) ModTime() time.Time { - return fi.modTime -} - -// IsDir return file whether a directory -func (fi bindataFileInfo) IsDir() bool { - return fi.mode&os.ModeDir != 0 -} - -// Sys return file is sys mode -func (fi bindataFileInfo) Sys() interface{} { - return nil -} - -var _smcTsv = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x95\xc1\x72\xab\x3a\x0f\xc7\xd7\x3d\x4f\xc1\xf0\x00\x1d\x4c\x92\x36\x67\x09\xa6\x05\x66\x42\xa2\x09\x29\x5f\x77\xdf\x10\xca\x6d\x99\x43\x02\x03\xf4\x9e\xe6\xed\xef\x58\xc6\xc6\x36\x64\xe9\x9f\x24\xdb\x92\xfe\xb2\xed\x13\x7d\xa7\xf6\x83\x0d\x2f\x34\xb6\x28\xbc\xd9\xbf\x18\x29\x4c\xe2\x80\xfd\x60\x53\x78\xb3\x88\x05\x5d\xf3\x53\x5d\xaa\xe1\xc6\x0d\x91\x34\x44\x65\x3e\xf4\xd5\xf5\x0f\xe7\xc1\x14\x90\x17\x7f\xf2\xcf\x92\xe3\x17\x81\xf9\xf2\x55\x5b\x12\x3a\x2e\x69\xd3\x95\x23\x73\x35\xe6\x22\x5b\x69\x6c\x85\x6c\xad\xb1\x35\xb2\x8d\xc6\x36\xc8\x9e\x34\xf6\x84\xec\x59\x63\xcf\xc8\xb6\x1a\xdb\x22\xf3\xe6\xc9\x5a\x5e\x3d\x3c\x72\xe3\x2c\xe3\xc9\x46\x44\xf9\x5c\xa3\x7c\x24\x92\x06\xad\x7c\x24\x98\x02\x94\xf2\x11\x51\x3e\x5e\x07\xf2\xaa\x2d\xfd\xf9\x66\xd3\x15\xfc\xd9\x8e\x93\x2d\x95\x0a\x48\x3d\x0e\x0a\x13\x78\x06\x08\x65\x48\x38\x4a\x24\x2c\x0c\x12\xa2\x68\x42\x78\xd3\x73\x0e\x51\x1a\x0c\x07\x15\x66\x15\x12\x13\xa0\xa8\x18\x50\x6b\x12\x92\x25\xda\x3b\xa9\xfd\x60\x27\xe5\xa5\xe9\x6e\xfa\x39\x09\x1e\x9f\x94\x17\xcb\xcf\x59\x21\x50\x4e\x09\xd1\x21\x16\x2e\xd9\x6a\xd0\xe7\x9e\xbf\x75\xc8\x3d\xc5\x69\x56\xd2\x7c\x7c\xd7\xa5\xdc\xd5\xc4\xe3\xbe\x06\x16\x3b\x9b\x18\xbd\xf7\x58\x97\x7d\xd3\x0d\x5f\xe7\xae\xfa\xf8\x2c\x45\x39\xf6\x98\x88\x6a\x90\x79\xf2\x19\xd9\x93\xfb\x0e\xe3\xd6\xac\x5b\x09\x8d\xa6\x2d\xa3\x11\xa8\xb5\x04\xbc\x01\x4c\x6e\x40\x4d\x80\x57\x61\x40\x2b\xb5\x87\xd8\xab\xba\x7f\xea\xe6\x2f\xbf\x93\x47\x54\x84\xb7\xf8\xc2\x43\xd9\x81\x6d\xd5\x8e\xe3\xfd\x45\x34\xc6\xfd\x5c\x8d\xe1\x78\x5f\x78\x33\xf3\xea\x7a\x6e\xf2\xee\x43\x3f\xbe\xe5\xb7\x6a\xfe\x96\xdd\x82\xb5\xe7\xd6\xbc\xbe\x58\xc7\xb2\x1f\x18\x3a\x23\xf2\x77\x54\xf7\xdc\x21\xde\xd1\x40\xc7\xff\x13\xd9\xb5\x4d\x37\xe8\xa6\x08\x4d\x51\x10\x58\x7e\x3e\x36\x23\x22\x2a\xc2\x84\x22\x57\x45\x98\x4f\xb4\x52\x11\xbe\x56\x07\xdc\xeb\xd0\x0e\x55\x91\xd7\x56\xd0\x55\xff\x62\xc9\x7d\xe7\xc4\xee\x9a\x0f\x43\xd9\xdd\xac\x53\xfa\xff\xc4\x7b\x47\x4e\x54\x8e\x47\xfb\xae\x8a\xf0\x68\x7f\xa5\x20\xa3\x56\x56\xfa\xdd\xb6\xf5\x18\xdb\xa2\x44\x74\x2e\x1f\x88\x96\xcc\x82\x5c\xce\x67\x41\xee\x14\xe4\xce\x82\x30\xf5\x76\x35\xe3\x98\x7f\xbb\x9e\x71\x7c\xb1\xdb\xcd\x8c\xe3\xab\x9d\xe2\x8d\x5f\x7e\xda\xfc\xda\x57\xcd\xd5\x4a\xeb\x66\xe8\xb9\x1a\x53\x14\x69\x8c\x88\x3d\xc7\x4d\x2f\x44\xb9\x60\xc1\x4c\x3c\x57\xb3\xb8\x4a\xcc\x6a\xc1\xc2\x62\x32\xea\xcc\xbe\xab\xcc\xf8\xc2\xb8\x9f\x3b\xfb\xae\x32\xe3\x0b\x5b\x23\x5b\xcf\xbe\xab\xcc\xf8\xc2\x9e\x90\x3d\xcd\xbe\xab\xcc\xf8\xc2\xd8\x77\x95\x65\xe4\x38\xb2\xec\x74\x62\x20\xc4\x0b\x87\xa3\x13\x23\x89\x73\x94\xaf\x27\x5b\xef\x31\x04\x68\x84\x0b\xf1\x6a\xb0\x45\xc0\x3d\xe5\x00\xa6\x8e\x75\xcc\xab\x1a\x4d\x1b\xc3\xb4\x91\x26\xc0\x28\xe2\x66\x92\x70\x9d\x31\x92\x15\x05\xde\x12\x2b\xcf\xa2\xad\x55\xc6\xc0\x71\x75\x94\xe0\x91\xa3\x8c\x48\x9f\x0d\x82\xc8\xd9\xe8\x20\xfb\x2d\x3d\x88\x8b\x24\x70\x8f\x06\xc9\x9e\x99\x8f\xf7\xfd\x53\xd5\x55\xde\xdd\xc6\xe3\x32\xec\x6f\x3a\xe4\xd7\x8f\xb3\x64\x5b\x95\xf1\x13\xca\x97\x51\x07\xa5\xd8\xcf\xf7\xf4\xd9\xca\xce\x98\x2d\x4d\x0e\xa9\x35\xd1\x58\x97\x09\x12\x29\x92\xac\x28\xe2\x03\x22\x57\x41\xf8\xc5\xc6\xd4\x11\xed\x1b\x6b\x17\xd3\x8d\x20\xc1\xd1\x4b\x90\x6c\x05\x81\xdd\x8e\x07\x85\x23\x08\x5f\xdf\x39\x48\x46\x20\xbb\x1c\x4f\x3a\x10\x3b\x27\xbc\xd5\xfc\x17\xa5\xcd\x75\xe8\x9a\xba\x2e\x3b\x6e\x9a\x24\x22\xfd\x55\x69\xc4\xf7\xa5\x11\xdf\x97\x46\x7c\xe0\x51\x55\x5f\x3c\x4a\xe6\x23\x13\x0f\x98\xa0\xe0\x63\x92\x5f\x79\xf7\x59\x76\x96\x9f\x1c\xf6\xf6\x2f\x1b\x16\xa6\x0f\x16\xa6\x0f\x16\xa6\x0f\x16\xa6\x0f\x16\xa6\x0f\x16\xa6\x0f\x16\xa6\x0f\x16\xa6\x0f\x28\xa8\xac\xe7\x48\x6f\x0e\x50\x08\xf4\x86\x02\x3d\x89\x86\x9e\x9a\x21\xaf\xb9\xd3\x6e\x86\x88\x21\x0d\x98\xa4\x31\x55\x1f\x42\xdc\x2c\x54\x23\x43\xe7\xa8\xb7\x1e\x96\xfa\x0b\x6a\x7f\x41\x3e\x0a\xd3\x69\x77\x3b\x0e\xf7\xc5\x00\xf7\xc5\x00\x91\xe3\xaa\x33\xaf\x70\x65\xce\x25\x6d\xcd\x57\x05\xf4\x61\x97\x78\x41\x63\xe0\xef\xe8\x5c\x63\xb0\xa8\x3c\x08\xb0\x80\x01\xb5\xe2\xeb\x54\xc2\x14\x61\x7a\xeb\x87\xf2\x22\xe8\x7f\x01\x00\x00\xff\xff\x1d\x32\xff\xb6\x46\x0d\x00\x00") - -func smcTsvBytes() ([]byte, error) { - return bindataRead( - _smcTsv, - "smc.tsv", - ) -} - -func smcTsv() (*asset, error) { - bytes, err := smcTsvBytes() - if err != nil { - return nil, err - } - - info := bindataFileInfo{name: "smc.tsv", size: 3398, mode: os.FileMode(420), modTime: time.Unix(1592914957, 0)} - a := &asset{bytes: bytes, info: info} - return a, nil -} - -// Asset loads and returns the asset for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func Asset(name string) ([]byte, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("Asset %s can't read by error: %v", name, err) - } - return a.bytes, nil - } - return nil, fmt.Errorf("Asset %s not found", name) -} - -// MustAsset is like Asset but panics when Asset would return an error. -// It simplifies safe initialization of global variables. -func MustAsset(name string) []byte { - a, err := Asset(name) - if err != nil { - panic("asset: Asset(" + name + "): " + err.Error()) - } - - return a -} - -// AssetInfo loads and returns the asset info for the given name. -// It returns an error if the asset could not be found or -// could not be loaded. -func AssetInfo(name string) (os.FileInfo, error) { - cannonicalName := strings.Replace(name, "\\", "/", -1) - if f, ok := _bindata[cannonicalName]; ok { - a, err := f() - if err != nil { - return nil, fmt.Errorf("AssetInfo %s can't read by error: %v", name, err) - } - return a.info, nil - } - return nil, fmt.Errorf("AssetInfo %s not found", name) -} - -// AssetNames returns the names of the assets. -func AssetNames() []string { - names := make([]string, 0, len(_bindata)) - for name := range _bindata { - names = append(names, name) - } - return names -} - -// _bindata is a table, holding each asset generator, mapped to its name. -var _bindata = map[string]func() (*asset, error){ - "smc.tsv": smcTsv, -} - -// AssetDir returns the file names below a certain -// directory embedded in the file by go-bindata. -// For example if you run go-bindata on data/... and data contains the -// following hierarchy: -// data/ -// foo.txt -// img/ -// a.png -// b.png -// then AssetDir("data") would return []string{"foo.txt", "img"} -// AssetDir("data/img") would return []string{"a.png", "b.png"} -// AssetDir("foo.txt") and AssetDir("notexist") would return an error -// AssetDir("") will return []string{"data"}. -func AssetDir(name string) ([]string, error) { - node := _bintree - if len(name) != 0 { - cannonicalName := strings.Replace(name, "\\", "/", -1) - pathList := strings.Split(cannonicalName, "/") - for _, p := range pathList { - node = node.Children[p] - if node == nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - } - } - if node.Func != nil { - return nil, fmt.Errorf("Asset %s not found", name) - } - rv := make([]string, 0, len(node.Children)) - for childName := range node.Children { - rv = append(rv, childName) - } - return rv, nil -} - -type bintree struct { - Func func() (*asset, error) - Children map[string]*bintree -} - -var _bintree = &bintree{nil, map[string]*bintree{ - "smc.tsv": &bintree{smcTsv, map[string]*bintree{}}, -}} - -// RestoreAsset restores an asset under the given directory -func RestoreAsset(dir, name string) error { - data, err := Asset(name) - if err != nil { - return err - } - info, err := AssetInfo(name) - if err != nil { - return err - } - err = os.MkdirAll(_filePath(dir, filepath.Dir(name)), os.FileMode(0755)) - if err != nil { - return err - } - err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) - if err != nil { - return err - } - err = os.Chtimes(_filePath(dir, name), info.ModTime(), info.ModTime()) - if err != nil { - return err - } - return nil -} - -// RestoreAssets restores an asset under the given directory recursively -func RestoreAssets(dir, name string) error { - children, err := AssetDir(name) - // File - if err != nil { - return RestoreAsset(dir, name) - } - // Dir - for _, child := range children { - err = RestoreAssets(dir, filepath.Join(name, child)) - if err != nil { - return err - } - } - return nil -} - -func _filePath(dir, name string) string { - cannonicalName := strings.Replace(name, "\\", "/", -1) - return filepath.Join(append([]string{dir}, strings.Split(cannonicalName, "/")...)...) -} diff --git a/devices/smc.tsv b/devices/smc.tsv new file mode 100644 index 0000000..f6ff37b --- /dev/null +++ b/devices/smc.tsv @@ -0,0 +1,162 @@ +"TCXC" "PECI CPU" +"TCXc" "PECI CPU" +"TC0P" "CPU 1 Proximity" +"TC0H" "CPU 1 Heatsink" +"TC0D" "CPU 1 Package" +"TC0E" "CPU 1" +"TC0F" "CPU 1" +"TC1C" "CPU Core 1" +"TC2C" "CPU Core 2" +"TC3C" "CPU Core 3" +"TC4C" "CPU Core 4" +"TC5C" "CPU Core 5" +"TC6C" "CPU Core 6" +"TC7C" "CPU Core 7" +"TC8C" "CPU Core 8" +"TCAH" "CPU 1 Heatsink Alt." +"TCAD" "CPU 1 Package Alt." +"TC1P" "CPU 2 Proximity" +"TC1H" "CPU 2 Heatsink" +"TC1D" "CPU 2 Package" +"TC1E" "CPU 2" +"TC1F" "CPU 2" +"TCBH" "CPU 2 Heatsink Alt." +"TCBD" "CPU 2 Package Alt." +"TCSC" "PECI SA" +"TCSc" "PECI SA" +"TCSA" "PECI SA" +"TCGC" "PECI GPU" +"TCGc" "PECI GPU" +"TG0P" "GPU Proximity" +"TG0D" "GPU Die" +"TG1D" "GPU Die" +"TG0H" "GPU Heatsink" +"TG1H" "GPU Heatsink" +"Ts0S" "Memory Proximity" +"TM0P" "Mem Bank A1" +"TM1P" "Mem Bank A2" +"TM8P" "Mem Bank B1" +"TM9P" "Mem Bank B2" +"TM0S" "Mem Module A1" +"TM1S" "Mem Module A2" +"TM8S" "Mem Module B1" +"TM9S" "Mem Module B2" +"TN0D" "Northbridge Die" +"TN0P" "Northbridge Proximity 1" +"TN1P" "Northbridge Proximity 2" +"TN0C" "MCH Die" +"TN0H" "MCH Heatsink" +"TP0D" "PCH Die" +"TPCD" "PCH Die" +"TP0P" "PCH Proximity" +"TA0P" "Airflow 1" +"TA1P" "Airflow 2" +"Th0H" "Heatpipe 1" +"Th1H" "Heatpipe 2" +"Th2H" "Heatpipe 3" +"Tm0P" "Mainboard Proximity" +"Tp0P" "Powerboard Proximity" +"Ts0P" "Palm Rest" +"Tb0P" "BLC Proximity" +"TL0P" "LCD Proximity" +"TW0P" "Airport Proximity" +"TH0P" "HDD Bay 1" +"TH1P" "HDD Bay 2" +"TH2P" "HDD Bay 3" +"TH3P" "HDD Bay 4" +"TO0P" "Optical Drive" +"TB0T" "Battery TS_MAX" +"TB1T" "Battery 1" +"TB2T" "Battery 2" +"TB3T" "Battery" +"Tp0P" "Power Supply 1" +"Tp0C" "Power Supply 1 Alt." +"Tp1P" "Power Supply 2" +"Tp1C" "Power Supply 2 Alt." +"Tp2P" "Power Supply 3" +"Tp3P" "Power Supply 4" +"Tp4P" "Power Supply 5" +"Tp5P" "Power Supply 6" +"TS0C" "Expansion Slots" +"TA0S" "PCI Slot 1 Pos 1" +"TA1S" "PCI Slot 1 Pos 2" +"TA2S" "PCI Slot 2 Pos 1" +"TA3S" "PCI Slot 2 Pos 2" +"VC0C" "CPU Core 1" +"VC1C" "CPU Core 2" +"VC2C" "CPU Core 3" +"VC3C" "CPU Core 4" +"VC4C" "CPU Core 5" +"VC5C" "CPU Core 6" +"VC6C" "CPU Core 7" +"VC7C" "CPU Core 8" +"VV1R" "CPU VTT" +"VG0C" "GPU Core" +"VM0R" "Memory" +"VN1R" "PCH" +"VN0C" "MCH" +"VD0R" "Mainboard S0 Rail" +"VD5R" "Mainboard S5 Rail" +"VP0R" "12V Rail" +"Vp0C" "12V Vcc" +"VV2S" "Main 3V" +"VR3R" "Main 3.3V" +"VV1S" "Main 5V" +"VH05" "Main 5V" +"VV9S" "Main 12V" +"VD2R" "Main 12V" +"VV7S" "Auxiliary 3V" +"VV3S" "Standby 3V" +"VV8S" "Standby 5V" +"VeES" "PCIe 12V" +"VBAT" "Battery" +"Vb0R" "CMOS Battery" +"IC0C" "CPU Core" +"IC1C" "CPU VccIO" +"IC2C" "CPU VccSA" +"IC0R" "CPU Rail" +"IC5R" "CPU DRAM" +"IC8R" "CPU PLL" +"IC0G" "CPU GFX" +"IC0M" "CPU Memory" +"IG0C" "GPU Rail" +"IM0C" "Memory Controller" +"IM0R" "Memory Rail" +"IN0C" "MCH" +"ID0R" "Mainboard S0 Rail" +"ID5R" "Mainboard S5 Rail" +"IO0R" "Misc. Rail" +"IB0R" "Battery Rail" +"IPBR" "Charger BMON" +"PC0C" "CPU Core 1" +"PC1C" "CPU Core 2" +"PC2C" "CPU Core 3" +"PC3C" "CPU Core 4" +"PC4C" "CPU Core 5" +"PC5C" "CPU Core 6" +"PC6C" "CPU Core 7" +"PC7C" "CPU Core 8" +"PCPC" "CPU Cores" +"PCPG" "CPU GFX" +"PCPD" "CPU DRAM" +"PCTR" "CPU Total" +"PCPL" "CPU Total" +"PC1R" "CPU Rail" +"PC5R" "CPU S0 Rail" +"PGTR" "GPU Total" +"PG0R" "GPU Rail" +"PM0R" "Memory Rail" +"PN0C" "MCH" +"PN1R" "PCH Rail" +"PC0R" "Mainboard S0 Rail" +"PD0R" "Mainboard S0 Rail" +"PD5R" "Mainboard S5 Rail" +"PH02" "Main 3.3V Rail" +"PH05" "Main 5V Rail" +"Pp0R" "12V Rail" +"PD2R" "Main 12V Rail" +"PO0R" "Misc. Rail" +"PBLC" "Battery Rail" +"PB0R" "Battery Rail" +"PDTR" "DC In Total" +"PSTR" "System Total" diff --git a/devices/temp_darwin.go b/devices/temp_darwin.go index ecdc9f1..414e761 100644 --- a/devices/temp_darwin.go +++ b/devices/temp_darwin.go @@ -4,9 +4,11 @@ package devices import ( "bytes" + _ "embed" "encoding/csv" "github.com/shirou/gopsutil/host" "io" + "log" ) // All possible thermometers @@ -19,7 +21,7 @@ func devs() []string { ids := loadIDs() sensors, err := host.SensorsTemperatures() if err != nil { - // FIXME log an error here + log.Printf("error getting sensor list for temps: %s", err) return []string{} } rv := make([]string, 0, len(sensors)) @@ -30,7 +32,7 @@ func devs() []string { continue } if label, ok := ids[sensor.SensorKey]; ok { - sensorMap[sensor.SensorKey] = label + sensorMap[sensor.SensorKey] = label rv = append(rv, label) } } @@ -46,22 +48,25 @@ func defs() []string { return rv } +//go:embed "smc.tsv" +var smcData []byte + // loadIDs parses the embedded smc.tsv data that maps Darwin SMC // sensor IDs to their human-readable labels into an array and returns the // array. The array keys are the 4-letter sensor keys; the values are the // human labels. func loadIDs() map[string]string { rv := make(map[string]string) - data, err := Asset("smc.tsv") - parser := csv.NewReader(bytes.NewReader(data)) + parser := csv.NewReader(bytes.NewReader(smcData)) parser.Comma = '\t' var line []string + var err error for { if line, err = parser.Read(); err == io.EOF { break } if err != nil { - // FIXME log an error here + log.Printf("error parsing SMC tags for temp widget: %s", err) break } // The line is malformed if len(line) != 2, but because the asset is static diff --git a/devices/temp_darwin_test.go b/devices/temp_darwin_test.go index 6222b57..a7389bd 100644 --- a/devices/temp_darwin_test.go +++ b/devices/temp_darwin_test.go @@ -3,9 +3,32 @@ package devices import ( + "bytes" + "encoding/csv" "testing" ) +func Test_NumCols(t *testing.T) { + parser := csv.NewReader(bytes.NewReader(smcData)) + parser.Comma = '\t' + var line []string + for { + if line, err = parser.Read(); err == io.EOF { + break + } + if err != nil { + log.Printf("error parsing SMC tags for temp widget: %s", err) + break + } + // The line is malformed if len(line) != 2, but because the asset is static + // it makes no sense to report the error to downstream users. This must be + // tested at/around compile time. + if len(line) == 2 { + t.Errorf("smc CSV data malformed: expected 2 columns, got %d", len(line)) + } + } +} + func Test_loadIDs(t *testing.T) { tests := []struct { key string diff --git a/dicts/de_DE.toml b/dicts/de_DE.toml new file mode 100644 index 0000000..93138f1 --- /dev/null +++ b/dicts/de_DE.toml @@ -0,0 +1,182 @@ +configfile="Konfigurationsdatei" +usage="Verwendung: {0} [optionen]\n\nOptionen:\n" +total="Gesamt" + + +[help] +paths="Nach ladbaren Farbschemata und Layouts sowie der Konfigurationsdatei wird in der folgenden Reihenfolge gesucht:" +log="Die Protokolldatei befindet sich in {0}" +written="Konfiguration geschrieben auf {0}" +help=""" +Beenden: q oder + +Prozessnavigation: + - k und : oben + - j und : nieder + - : halbe Seite nach oben + - : halbe Seite nach unten + - : ganze Seite nach oben + - : ganze Seite nach unten + - gg und : nach oben springen + - G und : nach unten springen + +Process actions: + - : Prozessgruppierung umschalten + - dd: Beende einen ausgewählten Prozess oder eine Gruppe von Prozessen mit SIGTERM (15) + - d3: Beende einen ausgewählten Prozess oder eine Gruppe von Prozessen mit SIGQUIT (3) + - d9: töte einen ausgewählten Prozess oder eine Gruppe von Prozessen mit SIGKILL (9) + +Prozesssortierung: + - c: CPU + - m: Mem + - p: PID + +Prozessfilterung: + - /: Filter bearbeiten + - (während der Bearbeitung): + - : Filter akzeptieren + - und : Filter löschen + +CPU- und Mem-Graph-Skalierung: + - h: skalieren in + - l: skalieren + +Netzwerk: + - b: Umschalten zwischen MBit / s und skalierten Bytes pro Sekunde +""" +# ÜBERSETZER: Bitte übersetzen Sie die Layout-**Namen** nicht +layouts = """Eingebaute Layouts: + default + minimal + battery + kitchensink""" +# ÜBERSETZER: Bitte übersetzen Sie die Farbschema-**Namen** nicht +colorschemes = """Eingebaute Farbschemata: + default + default-dark (für weißen Hintergrund) + solarized + solarized16-dark + solarized16-light + monokai + vice + nord""" +# ÜBERSETZER: Bitte übersetzen Sie die Widget-**Namen** nicht +widgets = """Widgets, die in Layouts verwendet werden können: + cpu - CPU-Lastdiagramm + mem - Physische & Swap-Speicher verwenden Grafik + temp - Sensortemperaturen + disk - Verwendung der physischen Festplattenpartition + power - Eine Batteriestange + net - Netzwerklast + procs - Interaktive Prozessliste""" + + +[args] +help="Hilfetext anzeigen." +color="Ein Farbschema feststellen." +scale="Stellen den Skalierungsfaktor ein, >0" +version="Zeigen die Version aus und beenden." +percpu="Zeigen Sie jede CPU im CPU-Widget an." +cpuavg="Durchschnittliche CPU im CPU-Widget anzeigen." +temp="Temperaturen in Fahrenheit anzeigen." +statusbar="Zeigen Sie eine Statusleiste mit der Uhrzeit an." +rate="Frequenz aktualisieren. Die meisten Zeiteinheiten werden akzeptiert. \"1m\" = jede Minute aktualisieren. \"100 ms\" = alle 100 ms aktualisieren." +layout="Name der Layoutspezifikationsdatei für die Benutzeroberfläche. Verwenden Sie \"-\", um zu leiten." +net="Wählen Sie die Netzwerkschnittstelle. Mehrere Schnittstellen können mit durch Kommas getrennten Werten definiert werden. Schnittstellen können auch mit ignoriert werden \"!\"" +export="Aktivieren Sie Metriken für den Export auf dem angegebenen Port." +mbps="Netzwerkrate als MBit / s anzeigen." +test="Führt Tests aus und beendet das Programm mit Erfolgs- / Fehlercode." +conffile="Konfigurationsdatei, die anstelle der Standardeinstellung verwendet werden soll (MUSS DAS ERSTE ARGUMENT SEIN)" +list=""" +List + devices: Druckt Gerätenamen für filterbare Widgets aus + layouts: Listet integrierte Layouts auf + colorschemes: Listet integrierte Farbschemata auf + paths: Listen Sie die Suchpfade für Konfigurationsdateien auf + widgets: Widgets, die in einem Layout verwendet werden können + keys: Zeigen Sie die Tastaturbindungen an. + langs: Unterstützte Sprachübersetzungen anzeigen.""" +write="Schreiben Sie eine Standardkonfigurationsdatei." + + +[config.err] +configsyntax="0| schlechte Syntax der Konfigurationsdatei; sollte KEY=VALUE sein, war {0}" +deprecation="1| Zeile {0}: '{1}' ist veraltet. Ignoriert {1}={2}" +line="2| Zeile #{0}: {1}" +tempscale="3| ungültiger TempScale-Wert {0}" + + +[error] +configparse="4| Konfigurationsdatei konnte nicht analysiert werden: {0}" +cliparse="5| Analysieren von CLI-Argumenten: {0}" +logsetup="6| Protokolldatei konnte nicht eingerichtet werden: {0}" +unknownopt="7| Unbekannte Option \"{0}\"; Probieren Sie layouts, colorschemes, keys, paths oder devices aus\n" +writefail="8| Konfigurationsdatei konnte nicht geschrieben werden: {0}" +checklog="9| aufgetretene Fehler; von {0}:" +metricsetup="10| Fehler beim Einrichten von {0}-Metriken: {1}" +nometrics="11| Keine Metriken für {0} {1}" +fatalfetch="12| Schwerwiegender Fehler beim Abrufen von {0}-Informationen: {1}" +recovfetch="13| behebbarer Fehler beim Abrufen von {0}-Informationen; überspringen {0}: {1}" +nodevfound="14| Keine verwendbare {0} gefunden" +setuperr="15| Fehler beim Einrichten {0}: {1}" +colorschemefile="16| Farbschemadatei konnte nicht gefunden werden {0} in {1}" +colorschemeread="17| Farbschemadatei konnte nicht gelesen werden {0}: {1}" +colorschemeparse="18| Farbschemadatei konnte nicht analysiert werden: {0}" +findlayout="19| Farbschemadatei konnte nicht gelesen werden {0}: {1}" +logopen="20| Protokolldatei konnte nicht geöffnet werden {0}: {1}" +table="21| Tabellen-Widget TopRow-Wert kleiner als 0. TopRow: {0}" +nohostname="22| Hostname konnte nicht abgerufen werden: {0}" + +[layout.error] +widget="23| Ungültiger Widget-Name {0}. Muss einer von sein {1}" +format="24| Layoutfehler in Zeile {0}: Format muss {1} sein. Fehler beim Parsen von {2} als int. Das Wort war {3}. Verwenden Sie eine Zeilenhöhe von 1." +slashes="25 | Layoutwarnung in Zeile {0}: zu viele '/' in Wort {1}; zusätzlichen Müll ignorieren." + +[widget.label] +disk=" Festplattennutzung " +cpu=" CPU auslastung " +gauge=" Leistungspegel " +battery=" Batteriestatus " +batt=" Batterie " +temp=" Temperaturen " +net=" Netzwerknutzung " +netint=" Netzwerknutzung: {0} " +mem=" Speichernutzung " + + +[widget.net.err] +netactivity="26 | Netzwerkaktivität von gopsutil konnte nicht abgerufen werden: {0}" +negvalrecv="27 | Fehler: negativer Wert für kürzlich empfangene Netzwerkdaten von gopsutil. RecentBytesRecv: {0}" +negvalsent="28 | Fehler: negativer Wert für kürzlich gesendete Netzwerkdaten von gopsutil. RecentBytesSent: {0}" + + +[widget.disk] +disk="Scheibe" +mount="Montieren" +used="Gebraucht" +free="Kostenlos" +rs="R / s" +ws="W / s" + + +[widget.proc] +filter=" Filter: " +label=" Prozesse " +[widget.proc.header] +count="Anzahl" +command="Befehl" +cpu="CPU%" +mem="Mem%" +pid="PID" +[widget.proc.err] +count="29 | CPU-Anzahl konnte nicht von gopsutil abgerufen werden: {0}" +retrieve="30 | Prozesse konnten nicht abgerufen werden: {0}" +ps="31 | Befehl 'ps' konnte nicht ausgeführt werden: {0}" +gopsutil="32 | Prozesse konnten nicht von gopsutil abgerufen werden: {0}" +pidconv="33 | Konvertierung der PID in int: {0} fehlgeschlagen. Linie 1}" +cpuconv="34 | Konvertierung der CPU-Auslastung in float fehlgeschlagen: {0}. Linie 1}" +memconv="35 | Die Verwendung von Mem konnte nicht in float konvertiert werden: {0}. Linie 1}" +getcmd="36 | Prozessbefehl von gopsutil konnte nicht abgerufen werden: {0}. psProc: {1}. i: {2}. pid: {3}" +cpupercent="37 | Fehler beim Abrufen der Prozess-CPU-Nutzung von gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +mempercent="38 | Prozessspeicherauslastung konnte nicht von gopsutil abgerufen werden: {0}. psProc: {1}. i: {2}. pid: {3}" +parse="39 | Ausgabe konnte nicht analysiert werden: {0}" diff --git a/dicts/en_US.toml b/dicts/en_US.toml new file mode 100644 index 0000000..bf1771b --- /dev/null +++ b/dicts/en_US.toml @@ -0,0 +1,183 @@ +configfile="Config file" +usage="Usage: {0} [options]\n\nOptions:\n" +total="Total" + + +[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}" +help=""" +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 (15) + - d3: kill selected process or group of processes with SIGQUIT (3) + - d9: kill selected process or group of processes with SIGKILL (9) + +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 + +Network: + - b: toggle between mbps and scaled bytes per second +""" +# TRANSLATORS: Please don't translate the layout **names** +layouts = """Built-in layouts: + default + minimal + battery + kitchensink""" +# TRANSLATORS: Please don't translate the colorcheme **names** +colorschemes = """Built-in colorschemes: + default + default-dark (for white background) + solarized + solarized16-dark + solarized16-light + monokai + vice + nord""" +# TRANSLATORS: Please don't translate the widget **names** +widgets = """Widgets that can be used in layouts: + cpu - CPU load graph + mem - Physical & swap memory use graph + temp - Sensor temperatures + disk - Physical disk partition use + power - A battery bar + net - Network load + procs - Interactive process list""" + + +[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." +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)" +# TRANSLATORS: Please don't translate the **labels** ("devices", "layouts") as they don't change in the code. +list=""" +List + devices: Prints out device names for filterable widgets + layouts: Lists built-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. + langs: Show supported language translations.""" +write="Write out a default config file." + + +[config.err] +configsyntax="0| bad config file syntax; should be KEY=VALUE, was {0}" +deprecation="1| line {0}: '{1}' is deprecated. Ignored {1}={2}" +line="2| line #{0}: {1}" +tempscale="3| invalid TempScale value {0}" + + +[error] +configparse="4| failed to parse config file: {0}" +cliparse="5| parsing CLI args: {0}" +logsetup="6| failed to setup log file: {0}" +unknownopt="7| Unknown option \"{0}\"; try layouts, colorschemes, keys, paths, or devices\n" +writefail="8| Failed to write configuration file: {0}" +checklog="9| errors encountered; from {0}:" +metricsetup="10| error setting up {0} metrics: {1}" +nometrics="11| no metrics for {0} {1}" +fatalfetch="12| fatal error fetching {0} info: {1}" +recovfetch="13| recoverable error fetching {0} info; skipping {0}: {1}" +nodevfound="14| no usable {0} found" +setuperr="15| error setting up {0}: {1}" +colorschemefile="16| failed to find colorscheme file {0} in {1}" +colorschemeread="17| failed to read colorscheme file {0}: {1}" +colorschemeparse="18| failed to parse colorscheme file: {0}" +findlayout="19| failed to read colorscheme file {0}: {1}" +logopen="20| failed to open log file {0}: {1}" +table="21| table widget TopRow value less than 0. TopRow: {0}" +nohostname="22| could not get hostname: {0}" + +[layout.error] +widget="23| Invalid widget name {0}. Must be one of {1}" +format="24| Layout error on line {0}: format must be {1}. Error parsing {2} as a int. Word was {3}. Using a row height of 1." +slashes="25| Layout warning on line {0}: too many '/' in word {1}; ignoring extra junk." + +[widget.label] +disk=" Disk Usage " +cpu=" CPU Usage " +gauge=" Power Level " +battery=" Battery Status " +batt=" Battery " +temp=" Temperatures " +net=" Network Usage " +netint=" Network Usage: {0} " +mem=" Memory Usage " + + +[widget.net.err] +netactivity="26| failed to get network activity from gopsutil: {0}" +negvalrecv="27| error: negative value for recently received network data from gopsutil. recentBytesRecv: {0}" +negvalsent="28| error: negative value for recently sent network data from gopsutil. recentBytesSent: {0}" + + +[widget.disk] +disk="Disk" +mount="Mount" +used="Used" +free="Free" +rs="R/s" +ws="W/s" + + +[widget.proc] +filter=" Filter: " +label=" Processes " +[widget.proc.header] +count="Count" +command="Command" +cpu="CPU%" +mem="Mem%" +pid="PID" +[widget.proc.err] +count="29| failed to get CPU count from gopsutil: {0}" +retrieve="30| failed to retrieve processes: {0}" +ps="31| failed to execute 'ps' command: {0}" +gopsutil="32| failed to get processes from gopsutil: {0}" +pidconv="33| failed to convert PID to int: {0}. line: {1}" +cpuconv="34| failed to convert CPU usage to float: {0}. line: {1}" +memconv="35| failed to convert Mem usage to float: {0}. line: {1}" +getcmd="36| failed to get process command from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +cpupercent="37| failed to get process cpu usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +mempercent="38| failed to get process memeory usage from gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +parse="39| failed to parse output: {0}" diff --git a/dicts/eo.toml b/dicts/eo.toml new file mode 100644 index 0000000..fb0f346 --- /dev/null +++ b/dicts/eo.toml @@ -0,0 +1,184 @@ +configfile="Argododosiero" +usage="Uzado: {0} [ebloj]\n\nEbloj:\n" +total="Sumo" + + +[help] +paths="Ŝarĝebla kloraj skemoj & enpaĝigoj, kaj la argododosiero, estas orda serĉatigis:" +log="Logodosiero troviĝas ĉe {0}" +written="Argordo skribiĝis ĉe {0}" +help=""" +Eliri: q aŭ + +Proceza navigadoj: + - k kaj : supren + - j kaj : malsupren + - : duona paĝo supren + - : duona paĝo malsupren + - : plena paĝo supren + - : plena paĝo malsupren + - gg kaj : salti al supron + - G kaj : salti al malsupron + +Proceza agoj: + - : alterni procezon grupigi + - dd: fini la elektitajn procezojn aŭ procezon grupigon kun SIGTERM (15) + - d3: fini la elektitajn procezojn aŭ procezon grupigon kun SIGQUIT (3) + - d9: fini la elektitajn procezojn aŭ procezon grupigon kun SIGKILL (9) + +Proceza ordigoj: + - c: CPU + - m: Memoro + - p: PID + +Proceza filtradoj: + - /: komenci redakti filtrilon + - (dum redaktadi): + - : akcepti filtrilon + - kaj : eliri filtrilon + +CPU kaj Memora grafilo skali: + - h: zomi + - l: malzomi + +Reto: + - b: alterni inter mbps kaj skale bajtoj por dua +""" +# TRANSLATORS: Please don't translate the layout **names** +layouts = """Enkonstruitaj enpaĝigoj: + default + minimal + battery + kitchensink""" +# TRANSLATORS: Please don't translate the colorscheme **names** +colorschemes = """Enkonstruitaj kloraj skemoj: + default + default-dark (por blanka fono) + solarized + solarized16-dark + solarized16-light + monokai + vice + nord""" +# TRANSLATORS: Please don't translate the widget **names** +widgets = """Enpaĝigaj Fenestraĵoj: + cpu - CPU ŝarĝa grafilo + mem - Fizika kay interŝanĝa memora grafilo + temp - Temperatura sensiloj + disk - Fizikaj diskdispartigaj uzadilo + power - Bateria mezurilo + net - Retuzadilo + procs - Interaga proceza listo""" + + +[args] +help="Ĉi tiun informoj." +color="Agordi kloraj skemoj." +scale="Agordi grafilan skalon, >0" +version="Montri version kaj eliri." +percpu="Montri ĉiun CPU en la CPU-fenestraĵo." +cpuavg="Montri duonan CPU en la CPU-fenestraĵo." +temp="Montri temperaturojn en fahrenheit." +statusbar="Montri statusbarbaron kun la tempo." +rate="Refreŝiga ofteco. Plej multaj unuoj akceptitaj. \"1m\" = refreŝigi ĉiun minuton. \"100ms\" = refreŝigi ĉiun dekonon minuton." +layout="Nomo de aranĝa specifa dosiero por la UI. Uzu \"-\" por pipi." +net="Elekti retinterfacon. Multaj interfacoj povas esti difinitaj per komparaj valoroj. Interfacoj ankaŭ povas esti ignorataj per \"!\"" +export="Ebligu metrikojn por eksportado en la specifita haveno." +mbps="Montri reta takson kiel mbps." +test="Ekzekutas testojn kaj forirojn kun sukceso / fiaska kodo." +conffile="Agordi dosiero por uzi anstataŭ defaŭlte (DEVAS ESTI UNUA ARGUMENTO)" +# TRANSLATORS: Please don't translate the list entries +list=""" +List + devices: Montras nomojn de aparatoj por filteblaj fenestraĵoj + layouts: Listigas enkonstruajn aranĝojn + colorschemes: Listas enkonstruitajn kloraj skemoj + paths: Enlistigu agordajn serĉajn vojojn de agordo + widgets: Fenestraĵoj uzeblaj en aranĝo + keys: Montri la klavarajn ligojn. + langs: Montru subtenatajn lingvajn tradukojn.""" +write="Skribu defaŭltan agordan dosieron." + + +[config.err] +configsyntax="0| malbona agordo dosiero-sintakso; estu ŜLOSI=VALORO, estis {0}" +deprecation="1| linio {0}: '{1}' malakceptas. Ignorita {1}={2}" +line="2| linio #{0}: {1}" +tempscale="3| malvalida TempScale-valoro {0}" + + +[error] +configparse="4| malsukcesis pari agordi dosiero: {0}" +cliparse="5| analizante CLI-argumentojn: {0}" +logsetup="6| malsukcesis agordi registro dosiero: {0}" +unknownopt="7| Nekonata opcio \"{0}\"; provu layouts, colorschemes, keys, paths, aŭ devices" +writefail="8| Malsukcesis skribi agordan dosieron: {0}" +checklog="9| eraroj renkontitaj; de {0}:" +metricsetup="10| eraro agordante {0} metrikojn: {1}" +nometrics="11| neniuj metrikoj por {0} {1}" +fatalfetch="12| fatala eraro elprenanta {0} info: {1}" +recovfetch="13| reakirebla eraro elprenanta {0} info; saltante {0}: {1}" +nodevfound="14| neniu uzebla {0} trovita" +setuperr="15| eraro agordante {0}: {1}" +colorschemefile="16| malsukcesis trovi kloraj skemoj dosiero {0} en {1}" +colorschemeread="17| malsukcesis legi kloraj skemoj dosiero {0}: {1}" +colorschemeparse="18| Fiaskis analizi kloraj skemoj dosiero: {0}" +findlayout="19| malsukcesis legi kloraj skemoj dosiero {0}: {1}" +logopen="20| malsukcesis malfermi enskribi dosieron {0}: {1}" +table="21| Tabla fenestraĵo TopRow-valoro malpli ol 0. TopRow: {0}" +nohostname="22| Ne povis akiri hostname: {0}" + +[layout.error] +widget="23| Malvalida fenestra nomo {0}. Devas esti unu el {1}" +format="24| Eraro pri aranĝo sur linio {0}: formato devas esti {1}. Eraro analizante {2} kiel int. Vorto estis {3}. Uzante vicon alteco de 1." +slashes="25| Averto pri aranĝo sur linio {0}: tro multaj '/' en vorto {1}; ignorante kroman rubon." + +[widget.label] +disk=" Disk Usado " +cpu=" CPU Usado " +gauge=" Potencnivelo " +battery=" Bateria Statuso " +batt=" Baterio " +temp=" Temperaturoj " +net=" Reta Usado " +netint=" Reta Usado: {0} " +mem=" Memoro Usado " + + +[widget.net.err] +netactivity="26| malsukcesis ricevi retactiveco de gopsutil: {0}" +negvalrecv="27| eraro: negativa valoro por ĵus ricevitaj retdatumoj de gopsutil. RecentBytesRecv: {0}" +negvalsent="28| eraro: negativa valoro por ĵus senditaj retdatumoj de gopsutil. RecentBytesSent: {0}" + + +[widget.disk] +disk="Disko" +mount="Monto" +used="Uzita" +free="Senpaga" +rs="R/s" +ws="W/s" + + +[widget.proc] +filter=" Filtrilo: " +label=" Procezoj " +[widget.proc.header] +count="Kalkulo" +command="Komando" +cpu="CPU%" +mem="Mem%" +pid="PID" + +[widget.proc.err] +count="29| malsukcesis akiri CPU-kalkuladon de gopsutil: {0}" +retrieve="30| ne sukcesis akiri procezojn: {0}" +ps="31| malsukcesis plenumi komandon 'ps': {0}" +gopsutil="32| malsukcesis akiri procezojn de gopsutilo: {0}" +pidconv="33| malsukcesis konverti PID al int: {0}. linio: {1}" +cpuconv="34| malsukcesis konverti CPU-uzon al flosilo: {0}. linio: {1}" +memconv="35| malsukcesis konverti Mem-uzon al flosilo: {0}. linio: {1}" +getcmd="36| malsukcesis akiri procezan komandon de gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +cpupercent="37| malsukcesis ricevi uzadon de proceso cpu de gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +mempercent="38| malsukcesis ricevi uzadon de proceza memoro de gopsutil: {0}. psProc: {1}. i: {2}. pid: {3}" +parse="39| ne sukcesis analizi eliron: {0}" diff --git a/dicts/tt_TT.toml b/dicts/tt_TT.toml new file mode 100644 index 0000000..812c01f --- /dev/null +++ b/dicts/tt_TT.toml @@ -0,0 +1,181 @@ +configfile="CFG FLE" +usage="egasU: {0} [snoitpo]\n\nsnoitpO:\n" +total="latoT" + + +[help] +paths="redro ni ,rof dehcraes era ,elif gifnoc eht dna ,stuoyal & semehcsroloc elbadaoL:" +log="ni si elif gol ehT {0}" +written="ot nettirw gifnoC {0}" +help=""" +>c-C< ro q :tiuQ + +:noitagivan ssecorP +pu :>pU< dna k - +nwod :>nwoD< dna j - +pu egap flah :>u-C< - +nwod egap flah :>d-C< - +pu egap lluf :>b-C< - +nwod egap lluf :>f-C< - +pot ot pmuj :>emoH< dna gg - +mottob ot pmuj :>dnE< dna G - + +:snoitca ssecorP +gnipuorg ssecorp elggot :>baT< - +)51( MRETGIS htiw sessecorp fo puorg ro ssecorp detceles llik :dd - +)3( TIUQGIS htiw sessecorp fo puorg ro ssecorp detceles llik :3d - +)9( LLIKGIS htiw sessecorp fo puorg ro ssecorp detceles llik :9d - + +:gnitros ssecorP +UPC :c - +meM :m - +DIP :p - + +:gniretlif ssecorP +retlif gnitide trats :/ - +:)gnitide elihw( - +retlif tpecca :>retnE< - +retlif raelc :>epacsE< dna >c-C< - + +:gnilacs hparg meM dna UPC +ni elacs :h - +tuo elacs :l - + +:krowteN +dnoces rep setyb delacs dna spbm neewteb elggot :b - +""" +# TRANSLATORS: Please don't translate the layout **names** +layouts = """stuoyal ni-tliuB: + tluafed + laminim + yrettab + knisnehctik""" +# TRANSLATORS: Please don't translate the colorcheme **names** +colorschemes = """semehcsroloc ni-tliuB: + tluafed + )dnuorgkcab etihw rof( krad-tluafed + deziralos + krad-61deziralos + thgil-61deziralos + iakonom + eciv""" +# TRANSLATORS: Please don't translate the widget **names** +widgets = """stuoyal ni desu eb nac taht stegdiW: + hparg daol UPC - upc + hparg esu yromem paws & lacisyhP - mem + serutarepmet rosneS - pmet + esu noititrap ksid lacisyhP - ksid + rab yrettab A - rewop + daol krowteN - ten + tsil ssecorp evitcaretnI - scorp""" + + +[args] +help=".neercs siht wohS" +color=".emehcsroloc a teS" +scale="0> ,rotcaf elacs hparG" +version=".tixe dna noisrev tnirP" +percpu=".tegdiw UPC eht ni UPC hcae wohS" +cpuavg=".tegdiw UPC eht ni UPC egareva wohS" +temp=".tiehnerhaf ni serutarepmet wohS.tiehnerhaf ni serutarepmet wohS" +statusbar=".emit eht htiw rabsutats a wohS" +rate=".sm001 yreve hserfer = \"sm001\" .etunim yreve hserfer = \"m1\" .detpecca stinu emit tsoM .ycneuqerf hserfeR" +layout="Name of layout spec file for the UI. Use \"-\" to pipe." +net="gnisu derongi eb osla nac secafretnI .seulav detarapes ammoc gnisu denifed eb nac secafretni lareveS .ecafretni krowten tceleS \"!\"" +export=".trop deificeps eht no tropxe rof scirtem elbanE" +mbps=".spbm sa etar krowten wohS" +test=".edoc eruliaf/sseccus htiw stixe dna stset snuR" +conffile=")TNEMUGRA TSRIF EB TSUM( tluafed fo daetsni esu ot elif gifnoC" +list=""" +>snart|syek|shtap|semehcsroloc|stuoyal|secived< tsiL +stegdiw elbaretlif rof seman ecived tuo stnirP :secived +stuoyal ni-dliub stsiL :stuoyal +semehcsroloc ni-tliub stsiL :semehcsroloc +shtap hcraes elif noitarugifnoc tuo tsiL :shtap +tuoyal a ni desu eb nac taht stegdiW :stegdiw +.sgnidnib draobyek eht wohS :syek +.snoitalsnart egaugnal detroppus wohS :sgnal""" +write=".elif gifnoc tluafed a tuo etirW" + + +[config.err] +configsyntax="0| saw ,EULAV=YEK eb dluohs ;xatnys elif gifnoc dab {0}" +deprecation="1| enil {0}: '{1}' derongI .detacerped si {1}={2}" +line="2| enil #{0}: {1}" +tempscale="3| eulav elacSpmeT dilavni {0}" + + +[error] +configparse="4| elif gifnoc esrap ot deliaf: {0}" +cliparse="8| sgra ILC gnisrap: {0}" +logsetup="9| elif gol putes ot deliaf: {0}" +unknownopt="10| noitpo nwonknU \"{0}\"; secived ro ,shtap ,syek ,semehcsroloc ,stuoyal yrt\n" +writefail="11| elif noitarugifnoc etirw ot deliaF: {0}" +checklog="12| morf ;deretnuocne srorre {0}:" +metricsetup="13| pu gnittes rorre {0} scirtem: {1}" +nometrics="14| rof scirtem on {0} {1}" +fatalfetch="15| gnihctef rorre lataf {0} ofni: {1}" +recovfetch="16| gnihctef rorre elbarevocer {0} gnippiks ;ofni {0}: {1}" +nodevfound="17| elbasu on {0} dnuof" +setuperr="18| pu gnittes rorre {0}: {1}" +colorschemefile="19| elif emehcsroloc dnif ot deliaf {0} ni {1}" +colorschemeread="20| elif emehcsroloc daer ot deliaf {0}: {1}" +colorschemeparse="21| elif emehcsroloc esrap ot deliaf: {0}" +findlayout="22| elif emehcsroloc daer ot deliaf {0}: {1}" +logopen="22| elif gol nepo ot deliaf {0}: {1}" +table="22| woRpoT .0 naht ssel eulav woRpoT tegdiw elbat: {0}" +nohostname="22| emantsoh teg ton dluoc: {0}" + +[layout.error] +widget="23| eman tegdiw dilavnI {0}. fo eno eb tsuM {1}" +format="24| enil no rorre tuoyaL {0}: eb tsum tamrof {1}. gnisrap rorrE {2} saw droW .tni a sa {3}. 1 fo thgieh wor a gnisU." +slashes="25| enil no gninraw tuoyaL {0}: drow ni '/' ynam oot {1}; knuj artxe gnirongi." + +[widget.label] +disk=" egasU ksiD " +cpu=" egasU UPC " +gauge=" leveL rewoP " +battery=" sutatS yrettaB " +batt=" yrettaB " +temp=" serutarepmeT " +net=" egasU krowteN " +netint=" egasU krowteN: {0} " +mem=" egasU yromeM " + + +[widget.net.err] +netactivity="26| lituspog morf ytivitca krowten teg ot deliaf: {0}" +negvalrecv="27| :vceRsetyBtnecer .lituspog morf atad krowten deviecer yltnecer rof eulav evitagen :rorre {0}" +negvalsent="28| :tneSsetyBtnecer .lituspog morf atad krowten tnes yltnecer rof eulav evitagen :rorre {0}" + + +[widget.disk] +disk="ksiD" +mount="tnuoM" +used="desU" +free="eerF" +rs="s/R" +ws="s/W" + + +[widget.proc] +filter=" :retliF " +label=" sessecorP " +[widget.proc.header] +count="tnuoC" +command="dnammoC" +cpu="%UPC" +mem="%meM" +pid="DIP" +[widget.proc.err] +count="29| :lituspog morf tnuoc UPC teg ot deliaf {0}" +retrieve="30| :sessecorp eveirter ot deliaf {0}" +ps="31| :dnammoc 'sp' etucexe ot deliaf {0}" +gopsutil="32| :lituspog morf sessecorp teg ot deliaf {0}" +pidconv="33| :tni ot DIP trevnoc ot deliaf {0}. enil: {1}" +cpuconv="34| :taolf ot egasu UPC trevnoc ot deliaf {0}. :enil {1}" +memconv="35| :taolf ot egasu meM trevnoc ot deliaf {0}. :enil {1}" +getcmd="36| :lituspog morf dnammoc ssecorp teg ot deliaf {0}. corPsp: {1}. i: {2}. dip: {3}" +cpupercent="37| lituspog morf egasu upc ssecorp teg ot deliaf: {0}. corPsp: {1}. i: {2}. dip: {3}" +mempercent="38| spog morf egasu yroemem ssecorp teg ot deliafutil: {0}. corPsp: {1}. i: {2}. dip: {3}" +parse="39| tuptuo esrap ot deliaf: {0}" diff --git a/dicts/zh_CN.toml b/dicts/zh_CN.toml new file mode 100644 index 0000000..b985788 --- /dev/null +++ b/dicts/zh_CN.toml @@ -0,0 +1,182 @@ +configfile="配置文件" +usage="使用方法: {0} [选项]\n\n选项:\n" +total="总计" + + +[help] +paths="按顺序从以下位置优先读取配色方案、布局方案和配置文件:" +log="日志文件位于 {0}" +written="配置文件已写入 {0}" +help=""" +退出: q or + +进程导航: + - k 或 : 上一行 + - j 或 : 下一行 + - : 上半页 + - : 下半页 + - : 上一页 + - : 下一页 + - gg 或 : 到顶部 + - G 或 : 到底部 + +进程操作: + - : 切换进程组 + - dd: 发送信号 SIGTERM (15) 终止进程或进程组 + - d3: 发送信号 SIGTERM (3) 终止进程或进程组 + - d9: 发送信号 SIGTERM (9) 终止进程或进程组 + +进程排序: + - c: CPU + - m: 内存 + - p: 进程标识 + +进程过滤: + - /: 开始编辑过滤器 + - (编辑时): + - : 保存过滤器 + - : 清除过滤器 + +CPU 和内存图形比例: + - h: 放大比例 + - l: 缩小比例 + +网络: + - b: 在 mbps 和 每秒字节数 之间切换 +""" +# TRANSLATORS: Please don't translate the layout **names** +layouts = """内建布局方案: + default + minimal + battery + kitchensink""" +# TRANSLATORS: Please don't translate the colorcheme **names** +colorschemes = """内建配色方案: + default + default-dark (用于白色背景) + solarized + solarized16-dark + solarized16-light + monokai + vice + nord""" +# TRANSLATORS: Please don't translate the widget **names** +widgets = """可被用于布局方案的组件名: + cpu - CPU 负载图 + mem - 物理内存和交换内存使用率图 + temp - 传感器温度 + disk - 物理磁盘和分区使用率 + power - 电池状态 + net -