Add uIRCd and twitch config
This commit is contained in:
parent
e1ea071bcb
commit
dcd108e2f4
|
@ -0,0 +1,10 @@
|
||||||
|
local cachefile=~/.cache/twitch
|
||||||
|
[ -r $cachefile ] || return
|
||||||
|
local -a stats
|
||||||
|
zstat -A stats +mtime -- $cachefile 2>/dev/null
|
||||||
|
if [ "${_cprompts_twitch[2]:-1}" -ne "${stats[1]:-0}" ]; then
|
||||||
|
local IFS=$'\n'
|
||||||
|
local streaming=($(< $cachefile))
|
||||||
|
typeset -g _cprompts_twitch=(${#streaming} $stats[1])
|
||||||
|
fi
|
||||||
|
[ ${_cprompts_twitch[1]} -gt 0 ] && p10k segment -b purple -i '' -t "${_cprompts_twitch[1]:-unknown}"
|
|
@ -0,0 +1,14 @@
|
||||||
|
local REPLY
|
||||||
|
local NICK
|
||||||
|
zstyle -s ':custom:prompts:uircd' nick NICK
|
||||||
|
zstyle -s ':custom:prompts:uircd' glob REPLY
|
||||||
|
local files=(${~REPLY}(.N))
|
||||||
|
local filtered=()
|
||||||
|
for i in $files; do
|
||||||
|
local IFS=$'\n'
|
||||||
|
local lines=($(tail -n100 $i))
|
||||||
|
filtered+=( ${(M)lines:#@time=$(date '+%F')* PRIVMSG * :*${NICK}*} )
|
||||||
|
done
|
||||||
|
typeset -g _cprompts_mentions_count=${#${(u)filtered}}
|
||||||
|
[[ ${_cprompts_mentions_count} -gt 0 ]] || return
|
||||||
|
p10k segment -b red -i '' -t "${_cprompts_mentions_count:-unknown}"
|
|
@ -32,7 +32,7 @@ fi
|
||||||
zstyle -s ':custom:preferences' prompt _cur_prompt
|
zstyle -s ':custom:preferences' prompt _cur_prompt
|
||||||
if [[ $_cur_prompt == "p9k" ]] && [[ -r "${ZDOTDIR}/powerlevel10k/powerlevel10k.zsh-theme" ]]; then
|
if [[ $_cur_prompt == "p9k" ]] && [[ -r "${ZDOTDIR}/powerlevel10k/powerlevel10k.zsh-theme" ]]; then
|
||||||
fpath+=("${ZDOTDIR}/powerlevel-config/segments")
|
fpath+=("${ZDOTDIR}/powerlevel-config/segments")
|
||||||
function {prompt_c_{covid_19,docker_host,mpv,new_mail,todo,weather,newsboat,mumble,sfeed},cprompts:cache:async:{covid,weather,rss}}() {
|
function {prompt_c_{covid_19,docker_host,mpv,new_mail,todo,weather,newsboat,mumble,sfeed,uircd,twitch},cprompts:cache:async:{covid,weather,rss}}() {
|
||||||
autoload -X
|
autoload -X
|
||||||
}
|
}
|
||||||
source ${ZDOTDIR}/powerlevel-config/all.zsh
|
source ${ZDOTDIR}/powerlevel-config/all.zsh
|
||||||
|
|
Loading…
Reference in New Issue