Fuck it, -340ms
This commit is contained in:
parent
bf0c2e52a8
commit
99971f7781
2
.zshrc
2
.zshrc
|
@ -2,7 +2,7 @@ if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]
|
||||||
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
|
||||||
fi
|
fi
|
||||||
[[ ! -f ${ZDOTDIR}/.p10k.zsh ]] || source ${ZDOTDIR}/.p10k.zsh
|
[[ ! -f ${ZDOTDIR}/.p10k.zsh ]] || source ${ZDOTDIR}/.p10k.zsh
|
||||||
source "${ZDOTDIR}/completions.zsh"
|
|
||||||
source "${ZDOTDIR}/preferences.zsh"
|
source "${ZDOTDIR}/preferences.zsh"
|
||||||
|
source "${ZDOTDIR}/completions.zsh"
|
||||||
source "${ZDOTDIR}/bindings.zsh"
|
source "${ZDOTDIR}/bindings.zsh"
|
||||||
source "${ZDOTDIR}/custom.zsh"
|
source "${ZDOTDIR}/custom.zsh"
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
source "${ZDOTDIR}/custom/segments.zsh"
|
||||||
|
source "${ZDOTDIR}/custom/prependsudo.zsh"
|
||||||
source "${ZDOTDIR}/custom/aliases.zsh"
|
source "${ZDOTDIR}/custom/aliases.zsh"
|
||||||
source "${ZDOTDIR}/custom/dirstack.zsh"
|
source "${ZDOTDIR}/custom/dirstack.zsh"
|
||||||
source "${ZDOTDIR}/custom/docker.zsh"
|
source "${ZDOTDIR}/custom/docker.zsh"
|
||||||
source "${ZDOTDIR}/custom/functions.zsh"
|
|
||||||
source "${ZDOTDIR}/custom/gpg.zsh"
|
source "${ZDOTDIR}/custom/gpg.zsh"
|
||||||
source "${ZDOTDIR}/custom/prependsudo.zsh"
|
source "${ZDOTDIR}/custom/functions.zsh"
|
||||||
source "${ZDOTDIR}/custom/segments.zsh"
|
|
||||||
|
|
|
@ -1,36 +1,13 @@
|
||||||
typeset -gi _pacman_check_time
|
|
||||||
typeset -gi _mail_count
|
typeset -gi _mail_count
|
||||||
typeset -gi _upgrade_packages
|
|
||||||
function prompt_docker_host() {
|
function prompt_docker_host() {
|
||||||
p10k segment -b blue -i '' -t "${DOCKER_HOST#*://}" -c "${DOCKER_HOST#*://}"
|
p10k segment -b blue -i '' -t "${DOCKER_HOST#*://}" -c "${DOCKER_HOST#*://}"
|
||||||
}
|
}
|
||||||
typeset -g POWERLEVEL9K_DOCKER_HOST_SHOW_ON_COMMAND='docker'
|
typeset -g POWERLEVEL9K_DOCKER_HOST_SHOW_ON_COMMAND='docker'
|
||||||
function prompt_dbus_mpris() {
|
|
||||||
typeset -g _mpris_LASTRESP="${_mpris_RESP:-0}"
|
|
||||||
typeset -g _mpris_RESP="$(busctl --user --json=short get-property org.mpris.MediaPlayer2.mpv /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player Metadata 2>/dev/null | jq '.data')"
|
|
||||||
if [[ $_mpris_RESP != $_mpris_LASTRESP ]]; then
|
|
||||||
typeset -g _mpris_RFMT="$(print ${_mpris_RESP} | jq --raw-output '."xesam:title".data // ""')"
|
|
||||||
local ARTIST="$(print ${_mpris_RESP} | jq --raw-output '."xesam:artist".data[0] // ""')"
|
|
||||||
[ ! -z ${ARTIST} ] && _mpris_RFMT="${ARTIST} - ${_mpris_RFMT%% \(*\)}"
|
|
||||||
fi
|
|
||||||
p10k segment -b purple -i '' -t "${_mpris_RFMT}" -c "${_mpris_RFMT}"
|
|
||||||
}
|
|
||||||
function prompt_new_mail() {
|
function prompt_new_mail() {
|
||||||
_mail_count=(~/Mail/*/Inbox/new/*(.N))
|
_mail_count=(~/Mail/*/Inbox/new/*(.N))
|
||||||
(( ${#_mail_count} > 0 )) || return
|
(( ${#_mail_count} > 0 )) || return
|
||||||
p10k segment -b yellow -i '' -t "${#_mail_count}"
|
p10k segment -b yellow -i '' -t "${#_mail_count}"
|
||||||
}
|
}
|
||||||
function prompt_pacman_upgrade() {
|
|
||||||
local -a stats
|
|
||||||
zstat -A stats +mtime -- /var/lib/pacman/sync 2>/dev/null
|
|
||||||
if [[ $stats[1] != $_pacman_check_time ]]; then
|
|
||||||
_upgrade_packages=$(pacman -Qu | wc -l)
|
|
||||||
_pacman_check_time=$stats[1]
|
|
||||||
fi
|
|
||||||
(( $_upgrade_packages > 0 )) || return
|
|
||||||
p10k segment -b cyan -i '' -t "${_upgrade_packages}"
|
|
||||||
}
|
|
||||||
typeset -g POWERLEVEL9K_PACMAN_UPGRADE_SHOW_ON_COMMAND='pacman'
|
|
||||||
function prompt_covid_19() {
|
function prompt_covid_19() {
|
||||||
local tmpfile=~/.cache/covidres
|
local tmpfile=~/.cache/covidres
|
||||||
local -a stats
|
local -a stats
|
||||||
|
|
|
@ -5,7 +5,7 @@ typeset -g ZLE_RPROMPT_INDENT=0
|
||||||
setopt appendhistory autocd auto_pushd correct_all extendedglob nomatch notify hist_ignore_all_dups hist_ignore_space nobeep
|
setopt appendhistory autocd auto_pushd correct_all extendedglob nomatch notify hist_ignore_all_dups hist_ignore_space nobeep
|
||||||
|
|
||||||
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
|
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
|
||||||
#typeset -g POWERLEVEL9K_MODE='nerdfont-fontconfig'
|
typeset -g POWERLEVEL9K_MODE='nerdfont-fontconfig'
|
||||||
if [ -z "$SSH_CONNECTION" ] && ! [ -z "$DISPLAY" ]; then
|
if [ -z "$SSH_CONNECTION" ] && ! [ -z "$DISPLAY" ]; then
|
||||||
source ${ZDOTDIR}/powerlevel10k/powerlevel10k.zsh-theme
|
source ${ZDOTDIR}/powerlevel10k/powerlevel10k.zsh-theme
|
||||||
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
[[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh
|
||||||
|
@ -30,11 +30,9 @@ if [ -z "$SSH_CONNECTION" ] && ! [ -z "$DISPLAY" ]; then
|
||||||
vim_shell
|
vim_shell
|
||||||
new_mail
|
new_mail
|
||||||
covid_19
|
covid_19
|
||||||
dbus_mpris
|
|
||||||
public_ip
|
public_ip
|
||||||
newline
|
newline
|
||||||
docker_host
|
docker_host
|
||||||
pacman_upgrade
|
|
||||||
vcs
|
vcs
|
||||||
virtualenv
|
virtualenv
|
||||||
pyenv
|
pyenv
|
||||||
|
|
Loading…
Reference in New Issue