add ais (rust fuzzy selector) and atproto plugin
This commit is contained in:
31
.zsh/plugin/atproto.zsh
Normal file
31
.zsh/plugin/atproto.zsh
Normal file
@@ -0,0 +1,31 @@
|
||||
# atproto shell integration
|
||||
# quick commands for atproto/ailog
|
||||
|
||||
if ! command -v ailog &>/dev/null; then
|
||||
return
|
||||
fi
|
||||
|
||||
# at: quick post
|
||||
at() {
|
||||
if [[ -z "$1" ]]; then
|
||||
echo "usage: at <text>"
|
||||
return 1
|
||||
fi
|
||||
ailog reply "$*" 2>/dev/null
|
||||
}
|
||||
|
||||
# atn: check notifications
|
||||
atn() {
|
||||
local count=$(ailog notify count 2>/dev/null | jq -r '.count // 0' 2>/dev/null)
|
||||
if [[ "$count" -gt 0 ]]; then
|
||||
echo "\e[33m${count}\e[0m notifications"
|
||||
ailog notify list 2>/dev/null | jq -r '.notifications[:5][] | "\(.reason) from @\(.author.handle // "unknown")"' 2>/dev/null
|
||||
else
|
||||
echo "no notifications"
|
||||
fi
|
||||
}
|
||||
|
||||
# atw: who am i
|
||||
atw() {
|
||||
ailog pds s 2>/dev/null | jq -r '"@\(.handle) on \(.pds)"' 2>/dev/null
|
||||
}
|
||||
Reference in New Issue
Block a user