diff --git a/custom/functions/recordscreen b/custom/functions/recordscreen index 99f7805..cd9c854 100644 --- a/custom/functions/recordscreen +++ b/custom/functions/recordscreen @@ -1,6 +1,9 @@ ffmpeg -y \ + -f pulse -i 1 \ -vaapi_device /dev/dri/renderD128 \ -video_size 1920x1080 -framerate 60 \ -f x11grab -i :0+1080 \ - -vf 'format=p010,hwupload,scale_vaapi=format=nv12' -c:v hevc_vaapi -b:v 15M \ + -vf 'hwupload,scale_vaapi=format=nv12' \ + -c:v hevc_vaapi -b:v 15M -qp 18 \ + -c:a aac -b:a 64k -ar 24000 -ac 2 \ $1 diff --git a/custom/functions/sendirc b/custom/functions/sendirc index 02939e3..d57e7d4 100644 --- a/custom/functions/sendirc +++ b/custom/functions/sendirc @@ -1,2 +1,2 @@ ([ -z $1 ] || [ -z $2 ] || [ -z $3 ]) && return -printf "PRIVMSG %s :%s\r\n" "$1" "${argv[3]}" | ssh n1 "> ~/IRC/$2/global/in" +printf "PRIVMSG %s :%s\r\n" "$1" "${argv[3]}" > ~/IRC/$2/global/in diff --git a/custom/segments/cprompts:cache:async:covid b/custom/segments/cprompts:cache:async:covid index eb719c9..dcd13aa 100644 --- a/custom/segments/cprompts:cache:async:covid +++ b/custom/segments/cprompts:cache:async:covid @@ -1,2 +1,4 @@ +local REPLY +zstyle -s ':custom:prompts:covid' country REPLY typeset -g _cprompts_covid=($(curl -sL https://api.covid19api.com/country/${REPLY:-germany} | jq -e '. |= sort_by (.Date) | .[-1,-2].Active')) [ ! -z $_cprompts_covid[1] ] && <<< ${_cprompts_covid} > $tmpfile diff --git a/custom/segments/cprompts:cache:async:weather b/custom/segments/cprompts:cache:async:weather index cb1e826..366c0a0 100644 --- a/custom/segments/cprompts:cache:async:weather +++ b/custom/segments/cprompts:cache:async:weather @@ -1,3 +1,7 @@ +local -A icons +local -A colors +icons=([c]='' [lc]='' [hc]='' [s]='🌢' [lr]='🌢' [hr]='' [sn]='' [t]='' [h]='' [sl]='') +colors=([c]="yellow" [lc]="yellow" [hc]="cyan" [s]="yellow" [lr]="cyan" [hr]="blue" [t]="white" [h]="white" [sl]="blue" [sn]="white") local REPLY zstyle -s ':custom:prompts:weather' location REPLY local result=$(curl -sL https://www.metaweather.com/api/location/${REPLY:-1339615}/ | jq -e '.consolidated_weather[0] | {"temp": .the_temp, "icon": .weather_state_abbr}') diff --git a/custom/segments/prompt_c_covid_19 b/custom/segments/prompt_c_covid_19 index 39e1bf5..7b5914e 100644 --- a/custom/segments/prompt_c_covid_19 +++ b/custom/segments/prompt_c_covid_19 @@ -1,14 +1,11 @@ ([ -v commands\[curl\] ] && [ -v commands\[jq\] ]) || return local tmpfile=${CACHEPATH}/covid -local REPLY -zstyle -s ':custom:prompts:covid' country REPLY + local -a stats -if [ ! -v _cprompts_covid ]; then - zstat -A stats +mtime -- $tmpfile 2>/dev/null - if [ ${stats[1]:-0} -lt $(($epochtime[1]-86400)) ]; then - cprompts:cache:async:covid &! - else - typeset -g _cprompts_covid=($(< $tmpfile)) - fi +zstat -A stats +mtime -- $tmpfile 2>/dev/null +if [ ${stats[1]:-0} -lt $(($epochtime[1]-43200)) ]; then + cprompts:cache:async:covid &! +else + typeset -g _cprompts_covid=($(< $tmpfile)) fi [ -v _cprompts_covid ] && p10k segment -b red -i '' -t "${_cprompts_covid[1]:-unknown} ($(( ${_cprompts_covid[1]:-0} - ${_cprompts_covid[2]:-0} )))" diff --git a/custom/segments/prompt_c_mpv b/custom/segments/prompt_c_mpv index 0feadde..a96845f 100644 --- a/custom/segments/prompt_c_mpv +++ b/custom/segments/prompt_c_mpv @@ -1,6 +1,9 @@ local REPLY zstyle -s ':custom:prompts:mpv' socket REPLY [ -S $REPLY ] && zsocket $REPLY 2>/dev/null || return -_cprompts_mpv[2]="${${$(print -u $REPLY '{ "command": ["get_property", "media-title"] }' && read -eEu $REPLY)#*\"data\"([^[:print:]])#:([^[:print:]])#\"}%%(\"~\\\")*}" +_cprompts_mpv[2]="${${$(\ + print -u $REPLY '{ "command": ["get_property", "media-title"] }' && \ + read -eEu $REPLY \ + )#*\"data\"([^[:print:]])#:([^[:print:]])#\"}%%(\"~\\\")*}" exec {REPLY}>&- [ -z $_cprompts_mpv[2] ] || p10k segment -b magenta -i '' -t "${_cprompts_mpv[2]}" diff --git a/custom/segments/prompt_c_sfeed b/custom/segments/prompt_c_sfeed index e1ff140..a4ef4d8 100644 --- a/custom/segments/prompt_c_sfeed +++ b/custom/segments/prompt_c_sfeed @@ -1,10 +1,11 @@ setopt local_options nomatch -feedpath=~/.sfeed/feeds/ local tmpfile=$CACHEPATH/rss +local feedpath=~/.sfeed/feeds/ [ -r $feedpath ] || return local -a cache + zstat -A cache +mtime -- $tmpfile 2>/dev/null -([ ! -v _cprompts_sfeed ] || [ ${cache[1]:-0} -lt $(($epochtime[1] - 1800)) ]) && cprompts:cache:async:rss &! +([ ! -v _cprompts_sfeed ] || [ ${cache[1]:-0} -lt $(($epochtime[1] - 300)) ]) && cprompts:cache:async:rss &! [ -r $tmpfile ] || return typeset -g _cprompts_sfeed=$(< $tmpfile) [ ${_cprompts_sfeed:-0} -ne 0 ] && p10k segment -b red -i '' -t "+${_cprompts_sfeed:-unknown}" diff --git a/custom/segments/prompt_c_weather b/custom/segments/prompt_c_weather index df31128..2a67504 100644 --- a/custom/segments/prompt_c_weather +++ b/custom/segments/prompt_c_weather @@ -1,37 +1,11 @@ ([ -v commands\[curl\] ] && [ -v commands\[jq\] ]) || return local tmpfile=$CACHEPATH/weather + local -a stats - -# Fancy stuff -local -A icons -local -A colors -icons[c]='' -colors[c]="yellow" -icons[lc]='' -colors[lc]="yellow" -icons[hc]='' -colors[hc]="cyan" -icons[s]='🌢' -colors[s]="yellow" -icons[lr]='🌢' -colors[lr]="cyan" -icons[hr]='' -colors[hr]="blue" -icons[t]='' -colors[t]="white" -icons[h]='' -colors[h]="white" -icons[sl]='' -colors[sl]="blue" -icons[sn]='' -colors[sn]="white" - -if [ ! -v _cprompts_weather ]; then - zstat -A stats +mtime -- $tmpfile 2>/dev/null - if [ ${stats[1]:-0} -lt $(($epochtime[1]-3600)) ]; then - cprompts:cache:async:weather &! - else - typeset -g _cprompts_weather=($(< $tmpfile)) - fi +zstat -A stats +mtime -- $tmpfile 2>/dev/null +if [ ${stats[1]:-0} -lt $(($epochtime[1]-3600)) ]; then + cprompts:cache:async:weather &! +else + typeset -g _cprompts_weather=($(< $tmpfile)) fi [ -v _cprompts_weather ] && p10k segment -b ${_cprompts_weather[2]:-white} -i ${_cprompts_weather[3]:-\?} -t "${_cprompts_weather[1]:-unknown}" diff --git a/powerlevel-config/status.zsh b/powerlevel-config/status.zsh index 6aef139..6b5b318 100644 --- a/powerlevel-config/status.zsh +++ b/powerlevel-config/status.zsh @@ -1,11 +1,6 @@ typeset -g POWERLEVEL9K_STATUS_EXTENDED_STATES=true -typeset -g POWERLEVEL9K_STATUS_OK=false -typeset -g POWERLEVEL9K_STATUS_OK_PIPE=true -typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' -typeset -g POWERLEVEL9K_STATUS_ERROR=true -typeset -g POWERLEVEL9K_STATUS_ERROR_VISUAL_IDENTIFIER_EXPANSION='✘' -typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL=true +typeset -g POWERLEVEL9K_STATUS_OK{,_PIPE}=false +typeset -g POWERLEVEL9K_STATUS_ERROR{,_{SIGNAL,PIPE}}=true typeset -g POWERLEVEL9K_STATUS_VERBOSE_SIGNAME=false -typeset -g POWERLEVEL9K_STATUS_ERROR_SIGNAL_VISUAL_IDENTIFIER_EXPANSION='✘' -typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE=true -typeset -g POWERLEVEL9K_STATUS_ERROR_PIPE_VISUAL_IDENTIFIER_EXPANSION='✘' +typeset -g POWERLEVEL9K_STATUS_OK_PIPE_VISUAL_IDENTIFIER_EXPANSION='✔' +typeset -g POWERLEVEL9K_STATUS_ERROR_{VISUAL,SIGNAL,PIPE}_IDENTIFIER_EXPANSION='✘' diff --git a/powerlevel-config/vi-mode.zsh b/powerlevel-config/vi-mode.zsh index 7e0eb7b..68f11fc 100644 --- a/powerlevel-config/vi-mode.zsh +++ b/powerlevel-config/vi-mode.zsh @@ -1,9 +1,11 @@ typeset -g POWERLEVEL9K_VI_MODE_FOREGROUND=0 -typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=NORMAL +typeset -g POWERLEVEL9K_VI_COMMAND_MODE_STRING=N typeset -g POWERLEVEL9K_VI_MODE_NORMAL_BACKGROUND=2 -typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=VISUAL +typeset -g POWERLEVEL9K_VI_VISUAL_MODE_STRING=V typeset -g POWERLEVEL9K_VI_MODE_VISUAL_BACKGROUND=4 -typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=OVERTYPE +typeset -g POWERLEVEL9K_VI_OVERWRITE_MODE_STRING=O typeset -g POWERLEVEL9K_VI_MODE_OVERWRITE_BACKGROUND=3 -typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING= -typeset -g POWERLEVEL9K_VI_MODE_INSERT_FOREGROUND=8 +typeset -g POWERLEVEL9K_VI_INSERT_MODE_STRING=I +typeset -g POWERLEVEL9K_VI_MODE_INSERT_BACKGROUND=5 +zle-line-init() { zle -K vicmd; } +zle -N zle-line-init