Initial commit.

Signed-off-by: Nicolás Ortega Froysa <nicolas@ortegas.org>
This commit is contained in:
Nicolás A. Ortega Froysa 2023-04-08 11:53:26 +02:00
commit 34772dd8a0
4 changed files with 89 additions and 0 deletions

22
LICENSE Normal file
View File

@ -0,0 +1,22 @@
MIT License
Copyright (c) 2009-2022 Robby Russell and contributors (https://github.com/ohmyzsh/ohmyzsh/contributors)
Copyright (c) 2023 Nicolás A. Ortega Froysa <nicolas@ortegas.org>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

24
README.md Normal file
View File

@ -0,0 +1,24 @@
# OMZ Gentoo Modified
The customized theme I use for Oh My Zsh (i.e. my ZSH prompt).
## Installation
Requirements:
- [Z Shell](https://www.zsh.org/)
- [Oh My Zsh](https://ohmyz.sh/)
Once you have these installed, simply run the `install.zsh` script.
## Acknowledgements
This theme is a very small variation on the `gentoo` theme that comes with Oh My
Zsh. You can check it out [on
GitHub](https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/gentoo.zsh-theme).
## License & Copyright
My modifications are absolutely minor, and in keeping with the original license
intention of the author I will also be distributing my theme under the [MIT
license](/LICENSE).

12
install.zsh Executable file
View File

@ -0,0 +1,12 @@
#!/usr/bin/env zsh
OMZ_HOME=$HOME/.oh-my-zsh
if ! [ -d $OMZ_HOME ]
then
echo "Failed to install. Oh My Zsh is not installed (in $OMZ_HOME)."
echo "Please install Oh My Zsh first."
exit 1
fi
install -m 644 ./omz-gentoo-mod.zsh-theme $OMZ_HOME/custom/themes

31
omz-gentoo-mod.zsh-theme Normal file
View File

@ -0,0 +1,31 @@
autoload -Uz colors && colors
autoload -Uz vcs_info
zstyle ':vcs_info:*' check-for-changes true
zstyle ':vcs_info:*' unstagedstr '%F{red}*' # display this when there are unstaged changes
zstyle ':vcs_info:*' stagedstr '%F{yellow}+' # display this when there are staged changes
zstyle ':vcs_info:*' actionformats '%F{5}(%F{2}%b%F{3}|%F{1}%a%c%u%m%F{5})%f '
zstyle ':vcs_info:*' formats '%F{5}(%F{2}%b%c%u%m%F{5})%f '
zstyle ':vcs_info:svn:*' branchformat '%b'
zstyle ':vcs_info:svn:*' actionformats '%F{5}(%F{2}%b%F{1}:%{3}%i%F{3}|%F{1}%a%c%u%m%F{5})%f '
zstyle ':vcs_info:svn:*' formats '%F{5}(%F{2}%b%F{1}:%F{3}%i%c%u%m%F{5})%f '
zstyle ':vcs_info:*' enable git cvs svn
zstyle ':vcs_info:git*+set-message:*' hooks untracked-git
+vi-untracked-git() {
if command git status --porcelain 2>/dev/null | command grep -q '??'; then
hook_com[misc]='%F{red}?'
else
hook_com[misc]=''
fi
}
gentoo_precmd() {
vcs_info
}
autoload -U add-zsh-hook
add-zsh-hook precmd gentoo_precmd
#PROMPT='%(!.%B%F{red}.%B%F{green}%n@)%m %F{blue}%(!.%1~.%~) ${vcs_info_msg_0_}%F{blue}%(!.#.$)%k%b%f '
PROMPT='%(!.%B%F{red}.%B%F{green}%n@)%m %F{blue}%c/ ${vcs_info_msg_0_}%F{blue}%(!.#.$)%k%b%f '