Skip to content

Commit

Permalink
fixed bug in zshrc_extra
Browse files Browse the repository at this point in the history
- added bpytop process monitor
- ToDo: Consider using zpm zsh plugin manager
  • Loading branch information
Phillip Miller committed Oct 22, 2021
1 parent ed17811 commit 4c0ffeb
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [v1.6.3](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.6.3) (2021-10-20)

[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.6.2...v1.6.3)

## [v1.6.2](https://github.com/mr-pmillz/pimp-my-shell/tree/v1.6.2) (2021-10-20)

[Full Changelog](https://github.com/mr-pmillz/pimp-my-shell/compare/v1.6.1...v1.6.2)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ All these configurations can be modified to your needs
- useful command syntax cheatsheets Ex. `cheat tar`
- [git-delta](https://github.com/dandavison/delta)
- Beautiful less pager for `git diff`
- [bpytop](https://github.com/aristocratos/bpytop)
- Nice process monitor for the cli
- **Oh-My-ZSH**
- **Theme**
- [Powerlevel10k](https://github.com/romkatv/powerlevel10k)
Expand Down
27 changes: 26 additions & 1 deletion extra/extra.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,15 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
if err := localio.RunCommandPipeOutput(fmt.Sprintf("cd %s && python3 get-pip.py || true", dirs.HomeDir)); err != nil {
return err
}
if err := localio.RunCommandPipeOutput("python3 -m pip install requests --user || true"); err != nil {
if err := localio.RunCommandPipeOutput("python3 -m pip install requests psutil --user || true"); err != nil {
return err
}
// Shows cpu core temperatures in bpytop
if err := localio.BrewInstallProgram("hacker1024/hacker1024/coretemp", "coretemp", packages); err != nil {
return err
}
// install bpytop
if err := localio.RunCommandPipeOutput("python3 -m pip install bpytop --user || true"); err != nil {
return err
}
}
Expand Down Expand Up @@ -136,6 +144,23 @@ func InstallExtraPackages(osType string, dirs *localio.Directories, packages *lo
return err
}
}

// download get-pip
if _, exists := localio.CommandExists("python3"); exists {
if err := localio.DownloadFile(fmt.Sprintf("%s/get-pip.py", dirs.HomeDir), "https://bootstrap.pypa.io/get-pip.py"); err != nil {
return err
}
if err := localio.RunCommandPipeOutput(fmt.Sprintf("cd %s && python3 get-pip.py || true", dirs.HomeDir)); err != nil {
return err
}
if err := localio.RunCommandPipeOutput("python3 -m pip install requests psutil --user || true"); err != nil {
return err
}
// install bpytop
if err := localio.RunCommandPipeOutput("python3 -m pip install bpytop --user || true"); err != nil {
return err
}
}
}
if err := updateGitConfig(); err != nil {
return err
Expand Down
4 changes: 3 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ require (
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/tidwall/match v1.0.3 // indirect
github.com/tidwall/pretty v1.2.0 // indirect
golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 // indirect
golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0 // indirect
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 // indirect
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
)
10 changes: 7 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ github.com/schollz/progressbar/v3 v3.8.3 h1:FnLGl3ewlDUP+YdSwveXBaXs053Mem/du+wr
github.com/schollz/progressbar/v3 v3.8.3/go.mod h1:pWnVCjSBZsT2X3nx9HfRdnCDrpbevliMeoEVhStwHko=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tidwall/gjson v1.9.1 h1:wrrRk7TyL7MmKanNRck/Mcr3VU1sdMvJHvJXzqBIUNo=
github.com/tidwall/gjson v1.9.1/go.mod h1:jydLKE7s8J0+1/5jC4eXcuFlzKizGrCKvLmBVX/5oXc=
github.com/tidwall/match v1.0.3 h1:FQUVvBImDutD8wJLN6c5eMzWtjgONK9MwIBCOrUJKeE=
Expand All @@ -52,8 +53,9 @@ golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0 h1:xrCZDmdtoloIiooiA9q0OQb9r8HejIHYoHGhGCe1pGg=
golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6 h1:foEbQz/B0Oz6YIqu/69kfXPYeFQAuuMYFkjaqXzl5Wo=
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b h1:9zKuko04nR4gjZ4+DNjHqRlAJqbJETHwiNKDqTfOjfE=
golang.org/x/term v0.0.0-20210615171337-6886f2dfbf5b/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand All @@ -68,7 +70,9 @@ gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c=
gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo=
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
periph.io/x/periph v3.6.8+incompatible h1:lki0ie6wHtvlilXhIkabdCUQMpb5QN4Fx33yNQdqnaA=
periph.io/x/periph v3.6.8+incompatible/go.mod h1:EWr+FCIU2dBWz5/wSWeiIUJTriYv9v2j2ENBmgYyy7Y=
2 changes: 1 addition & 1 deletion zsh/templates/darwin/zshrc_extra.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# Set GOPATH, GOROOT and add GOROOT to path
if [[ -z "${GOPATH}" ]]; then export GOPATH="${HOME}/go"; fi
if [[ -z "${GOROOT}" ]]; then export GOROOT="$(brew --prefix golang)/libexec"; fi
if [[ ":$PATH:" != *":${GOROOT}/bin:"* ]] && export PATH="${PATH}:${GOROOT}/bin"
[[ ":$PATH:" != *":${GOROOT}/bin:"* ]] && export PATH="${PATH}:${GOROOT}/bin"

# Set CTRL+U to only delete backwards to the left of the cursor.
bindkey \^U backward-kill-line
Expand Down
2 changes: 1 addition & 1 deletion zsh/templates/linux/zshrc_extra.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[[ ":$PATH:" != *":${HOME}/go/bin:"* ]] && export PATH="${PATH}:${HOME}/go/bin"
# Set GOPATH
if [[ -z "${GOPATH}" ]]; then export GOPATH="${HOME}/go"; fi
if [[ ":$PATH:" != *":/usr/local/go/bin:"* ]] && export PATH="${PATH}:/usr/local/go/bin"
[[ ":$PATH:" != *":/usr/local/go/bin:"* ]] && export PATH="${PATH}:/usr/local/go/bin"

# Set CTRL+U to only delete backwards to the left of the cursor.
bindkey \^U backward-kill-line
Expand Down

0 comments on commit 4c0ffeb

Please sign in to comment.