AutoYADM commit: 2025-03-29 14:15:07

This commit is contained in:
Daniel Fichtinger 2025-03-29 14:15:07 -04:00
parent fc2586d9fb
commit 3fe7111206

View file

@ -0,0 +1,25 @@
function pb --description 'Upload a paste to sr.ht'
set -l cmd $argv[1]
set -l args $argv[2..]
switch $cmd
case create
set -l output (hut paste create $args)
if not test $status = 0
echo 'Error creating paste!'
false
return
end
set -l url (string match -r 'https://paste\.sr\.ht/.+/[a-zA-Z0-9]+$' $output)
echo $url | wl-copy
echo "$url copied to clipboard."
case copy
set -l lines (string split \n (hut paste list))
echo $lines
case '*'
echo 'Unhandled case!'
# echo ">$cmd<"
false
return
end
end