mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-08 04:34:00 +02:00
Merge e1973661e6 into 5667161d49
This commit is contained in:
commit
c53acaedb4
4 changed files with 62 additions and 0 deletions
32
lib/android.zsh
Normal file
32
lib/android.zsh
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
function android_sdk_version() {
|
||||||
|
sdk=$(xmlstarlet sel -t -v "/manifest/uses-sdk/@android:minSdkVersion" AndroidManifest.xml 2> /dev/null) || return
|
||||||
|
versions[1]='1.0 Base'
|
||||||
|
versions[2]='1.1 Base 1.1'
|
||||||
|
versions[3]='1.5 Cupcake'
|
||||||
|
versions[4]='1.6 Cupcake'
|
||||||
|
versions[5]='2.0 Eclair'
|
||||||
|
versions[6]='2.0.1 Eclair 0.1'
|
||||||
|
versions[7]='2.1 Eclair MR1'
|
||||||
|
versions[8]='2.2 Froyo'
|
||||||
|
versions[9]='2.3.0-2 Gingerbread'
|
||||||
|
versions[10]='2.3.3-4 Gingerbread MR1'
|
||||||
|
versions[11]='3.0 Honeycomb'
|
||||||
|
versions[12]='3.1 Honeycomb MR1'
|
||||||
|
versions[13]='3.2 Honeycomb MR2'
|
||||||
|
versions[14]='4.0.0-2 Ice Cream Sandwich'
|
||||||
|
versions[15]='4.0.0-2 Ice Cream Sandwich MR1'
|
||||||
|
version="$versions[$sdk]"
|
||||||
|
echo "$version"
|
||||||
|
}
|
||||||
|
|
||||||
|
function android_package_name() {
|
||||||
|
package=$(xmlstarlet sel -t -v "/manifest/@package" AndroidManifest.xml 2> /dev/null) || return
|
||||||
|
echo "$package"
|
||||||
|
}
|
||||||
|
|
||||||
|
function android_prompt_info() {
|
||||||
|
if [ -n "$(android_sdk_version)" ]; then
|
||||||
|
echo "${ZSH_THEME_ANDROID_PROMPT_PREFIX}$(android_package_name) $(android_sdk_version)${ZSH_THEME_ANDROID_PROMPT_SUFFIX}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
7
lib/mercurial.zsh
Normal file
7
lib/mercurial.zsh
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
function hg_prompt_info() {
|
||||||
|
branch=$(hg id -b 2> /dev/null) || return
|
||||||
|
tag=$(hg id -t 2> /dev/null) || return
|
||||||
|
rev_number=$(hg id -n 2> /dev/null) || return
|
||||||
|
rev_id=$(hg id -i 2> /dev/null) || return
|
||||||
|
echo "${ZSH_THEME_HG_PROMPT_PREFIX}${rev_number/\+/}:${rev_id/\+/}@${branch}(${tag})${ZSH_THEME_HG_PROMPT_SUFFIX}"
|
||||||
|
}
|
||||||
|
|
@ -49,6 +49,7 @@ if [[ $use_sudo -eq 1 ]]; then
|
||||||
alias ad='sudo $apt_pref update'
|
alias ad='sudo $apt_pref update'
|
||||||
alias adg='sudo $apt_pref update && sudo $apt_pref $apt_upgr'
|
alias adg='sudo $apt_pref update && sudo $apt_pref $apt_upgr'
|
||||||
alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
|
alias adu='sudo $apt_pref update && sudo $apt_pref dist-upgrade'
|
||||||
|
alias adus="sudo $apt_pref update && sudo $apt_pref-s dist-upgrade"
|
||||||
alias afu='sudo apt-file update'
|
alias afu='sudo apt-file update'
|
||||||
alias ag='sudo $apt_pref $apt_upgr'
|
alias ag='sudo $apt_pref $apt_upgr'
|
||||||
alias ai='sudo $apt_pref install'
|
alias ai='sudo $apt_pref install'
|
||||||
|
|
|
||||||
22
themes/zalew.zsh-theme
Normal file
22
themes/zalew.zsh-theme
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
# ZSH Theme - Preview: http://gyazo.com/8becc8a7ed5ab54a0262a470555c3eed.png
|
||||||
|
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
|
||||||
|
|
||||||
|
local user='%{$fg[green]%}%n%{$reset_color%}'
|
||||||
|
local user_host='%{$fg[green]%}%n@%m%{$reset_color%}'
|
||||||
|
local current_dir='%{$terminfo[bold]$fg[blue]%} %~%{$reset_color%}'
|
||||||
|
|
||||||
|
local git_branch='$(git_prompt_info)%{$reset_color%}'
|
||||||
|
local hg_info='$(hg_prompt_info)'
|
||||||
|
local android_info='$(android_prompt_info)'
|
||||||
|
|
||||||
|
PROMPT="╭─${user} ${current_dir} ${android_info}${git_branch}${hg_info}
|
||||||
|
╰─%B$%b "
|
||||||
|
RPS1="${return_code}"
|
||||||
|
|
||||||
|
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg[yellow]%}‹"
|
||||||
|
ZSH_THEME_GIT_PROMPT_SUFFIX="› %{$reset_color%}"
|
||||||
|
ZSH_THEME_HG_PROMPT_PREFIX=$ZSH_THEME_GIT_PROMPT_PREFIX
|
||||||
|
ZSH_THEME_HG_PROMPT_SUFFIX=$ZSH_THEME_GIT_PROMPT_SUFFIX
|
||||||
|
|
||||||
|
ZSH_THEME_ANDROID_PROMPT_PREFIX="%{$fg[green]%}‹"
|
||||||
|
ZSH_THEME_ANDROID_PROMPT_SUFFIX="› %{$reset_color%}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue