Compare commits

...

5 Commits

Author SHA1 Message Date
3w36zj6 1893591686
Merge 59ff7f8bef into b97926675a 2026-01-23 22:01:09 -08:00
Roman Perepelitsa b97926675a formatting 2026-01-22 15:10:11 +01:00
Roman Perepelitsa 3d2c72244d align realtime time updates to POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL_SEC (#2916) 2026-01-22 15:09:16 +01:00
Roman Perepelitsa 447d0b2e68 make realtime time update interval configurable (#2916) 2026-01-22 14:12:49 +01:00
3w36zj6 59ff7f8bef docs: add Sheldon to Installation in README 2024-08-15 06:34:14 +09:00
2 changed files with 25 additions and 2 deletions

View File

@ -431,6 +431,7 @@ Powerlevel10k.
- [Arch Linux](#arch-linux) - [Arch Linux](#arch-linux)
- [Alpine Linux](#alpine-linux) - [Alpine Linux](#alpine-linux)
- [Fig](#fig) - [Fig](#fig)
- [Sheldon](#sheldon)
### Manual ### Manual
@ -549,6 +550,21 @@ ln -s /usr/share/zsh/plugins/powerlevel10k ~/.local/share/zsh/plugins/
Follow the instructions on Follow the instructions on
[this page](https://fig.io/plugins/other/powerlevel10k). [this page](https://fig.io/plugins/other/powerlevel10k).
### Sheldon
Add the following to the Sheldon config file.
```toml
[plugins.powerlevel10k]
github = "romkatv/powerlevel10k"
```
Or run the following to automatically add it.
```zsh
sheldon add powerlevel10k --github romkatv/powerlevel10k
```
## Configuration ## Configuration
- [For new users](#for-new-users) - [For new users](#for-new-users)

View File

@ -3527,7 +3527,9 @@ _p9k_prompt_time_compute() {
} }
_p9k_prompt_time_async() { _p9k_prompt_time_async() {
sleep 1 || true zmodload zsh/mathfunc zsh/zselect || return
local -F t=_POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL_SEC
zselect -t $((int(ceil(100 * (t - EPOCHREALTIME % t))))) || true
} }
_p9k_prompt_time_sync() { _p9k_prompt_time_sync() {
@ -7809,8 +7811,13 @@ _p9k_init_params() {
# commands will contain the start times of their commands as opposed to the default # commands will contain the start times of their commands as opposed to the default
# behavior where they contain the end times of their preceding commands. # behavior where they contain the end times of their preceding commands.
_p9k_declare -b POWERLEVEL9K_TIME_UPDATE_ON_COMMAND 0 _p9k_declare -b POWERLEVEL9K_TIME_UPDATE_ON_COMMAND 0
# If set to true, time will update every second. # If set to true, time will update every
# POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL_SEC seconds.
_p9k_declare -b POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME 0 _p9k_declare -b POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME 0
_p9k_declare -F POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL_SEC 1
if (( _POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL_SEC <= 0 )); then
_POWERLEVEL9K_EXPERIMENTAL_TIME_REALTIME_INTERVAL_SEC=1
fi
_p9k_declare -b POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH 0 _p9k_declare -b POWERLEVEL9K_NIX_SHELL_INFER_FROM_PATH 0
typeset -g _p9k_nix_shell_cond='${IN_NIX_SHELL:#0}' typeset -g _p9k_nix_shell_cond='${IN_NIX_SHELL:#0}'