1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-14 00:50:08 +00:00

add p10k configure

This commit is contained in:
romkatv 2019-07-31 18:21:37 +02:00
parent 070697a914
commit a6b572da45
5 changed files with 18 additions and 8 deletions

View file

@ -83,7 +83,7 @@ Add `antibody bundle romkatv/powerlevel10k` to your `~/.zshrc`.
### For new users ### For new users
On the first run Powerlevel10k configuration wizard will ask you a few questions and configure On the first run Powerlevel10k configuration wizard will ask you a few questions and configure
your prompt. If it doesn't trigger automatically, type `p9k_configure`. your prompt. If it doesn't trigger automatically, type `p10k configure`.
### For Powerlevel9k users ### For Powerlevel9k users
@ -92,7 +92,7 @@ will pick them up and provide you with the same prompt UI you are used to. Power
all configuration options used by Powerlevel9k. See Powerlevel9k all configuration options used by Powerlevel9k. See Powerlevel9k
[configuration guide](https://github.com/bhilburn/powerlevel9k#prompt-customization). [configuration guide](https://github.com/bhilburn/powerlevel9k#prompt-customization).
To go beyond the functionality of Powerlevel9k, type `p9k_configure` and explore the unique styles To go beyond the functionality of Powerlevel9k, type `p10k configure` and explore the unique styles
and features Powerlevel10k has to offer. and features Powerlevel10k has to offer.
## Fonts ## Fonts
@ -120,7 +120,7 @@ sudo apt install libglib2.0-bin
gsettings set org.gnome.desktop.interface monospace-font-name 'MesloLGS NF 11' gsettings set org.gnome.desktop.interface monospace-font-name 'MesloLGS NF 11'
``` ```
Run `p9k_configure` to pick the best style for your new font. Run `p10k configure` to pick the best style for your new font.
_Using a different terminal and know how to set font for it? Share your knowledge by sending a PR _Using a different terminal and know how to set font for it? Share your knowledge by sending a PR
to expand the list!_ to expand the list!_

View file

@ -11,7 +11,7 @@
# For example, just like in Pure, prompt will provide no indication of Git status being stale. # For example, just like in Pure, prompt will provide no indication of Git status being stale.
# This is likely to make user experience worse than with any other Powerlevel10k config. If # This is likely to make user experience worse than with any other Powerlevel10k config. If
# you like the general style of Pure but not particularly attached to all its quirks, type # you like the general style of Pure but not particularly attached to all its quirks, type
# `p9k_configure` while having Powerlevel10k theme active and pick lean style. # `p10k configure` while having Powerlevel10k theme active and pick lean style.
# Temporarily disable aliases. # Temporarily disable aliases.
if [[ -o 'aliases' ]]; then if [[ -o 'aliases' ]]; then

View file

@ -14,7 +14,7 @@ function _p9k_can_configure() {
setopt err_return extended_glob no_prompt_{bang,subst} prompt_{cr,percent,sp} setopt err_return extended_glob no_prompt_{bang,subst} prompt_{cr,percent,sp}
[[ $1 == '-q' ]] && local -i q=1 || local -i q=0 [[ $1 == '-q' ]] && local -i q=1 || local -i q=0
function $0_error() { function $0_error() {
(( q )) || print -P "%1F[ERROR]%f %Bp9k_configure%b: $1" >&2 (( q )) || print -P "%1F[ERROR]%f %Bp10k configure%b: $1" >&2
return 1 return 1
} }
{ {

View file

@ -4329,6 +4329,16 @@ prompt_powerlevel9k_teardown() {
fi fi
} }
function p10k() {
emulate -L zsh && setopt no_hist_expand extended_glob
if [[ $# == 1 && $1 == configure ]]; then
p9k_configure
else
print -P "Usage: %2Fp10k%f %Bconfigure%b" >&2
return 1
fi
}
# Hook for zplugin. # Hook for zplugin.
powerlevel10k_plugin_unload() { prompt_powerlevel9k_teardown; } powerlevel10k_plugin_unload() { prompt_powerlevel9k_teardown; }

View file

@ -138,7 +138,7 @@ function quit() {
if (( force )); then if (( force )); then
print -P "Powerlevel10k configuration wizard has been aborted. To run it again, type:" print -P "Powerlevel10k configuration wizard has been aborted. To run it again, type:"
print -P "" print -P ""
print -P " %2Fp9k_configure%f" print -P " %2Fp10k%f %Bconfigure%b"
print -P "" print -P ""
else else
print -P "Powerlevel10k configuration wizard has been aborted. It will run again" print -P "Powerlevel10k configuration wizard has been aborted. It will run again"
@ -150,7 +150,7 @@ function quit() {
print -P "" print -P ""
print -P "To run Powerlevel10k configuration wizard right now, type:" print -P "To run Powerlevel10k configuration wizard right now, type:"
print -P "" print -P ""
print -P " %2Fp9k_configure%f" print -P " %2Fp10k%f %Bconfigure%b"
print -P "" print -P ""
fi fi
exit 1 exit 1
@ -936,7 +936,7 @@ function write_zshrc() {
fi fi
local comments=( local comments=(
"# To customize prompt, run \`p9k_configure\` or edit $__p9k_cfg_path_u." "# To customize prompt, run \`p10k configure\` or edit $__p9k_cfg_path_u."
) )
print -lr -- "" $comments "source $__p9k_cfg_path_u" >>$__p9k_zshrc print -lr -- "" $comments "source $__p9k_cfg_path_u" >>$__p9k_zshrc