Tweak some stuff and shorten some intervals

This commit is contained in:
Alex D. 2020-10-24 13:41:04 +02:00
parent 88249df682
commit 5069ed56c2
Signed by: caskd
GPG Key ID: F92BA85F61F4C173
10 changed files with 41 additions and 60 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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}')

View File

@ -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} )))"

View File

@ -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]}"

View File

@ -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}"

View File

@ -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}"

View File

@ -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='✘'

View File

@ -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