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

This commit is contained in:
Daniel Fichtinger 2025-03-29 14:45:07 -04:00
parent 1c117017d3
commit 9d3cf48e38

View file

@ -1,3 +1,6 @@
# This function lets the user conveniently upload a paste to sr.ht,
# and copy its url. You can also copy the url of a paste
# you've already uploaded.
function pb --description 'Upload a paste to sr.ht' function pb --description 'Upload a paste to sr.ht'
set -l cmd $argv[1] set -l cmd $argv[1]
set -l args $argv[2..] set -l args $argv[2..]
@ -30,12 +33,14 @@ function pb --description 'Upload a paste to sr.ht'
set --function list $list $append set --function list $list $append
end end
end end
printf '%s\n' $list set -l selection (printf '%s\n' $list | fzf)
set -l selection (echo $list | fzf) set -l hash (string split ' ' $selection)[2]
echo $selection set -l srht_user (string split ' ' (hut meta show)[1])[1]
set -l url "https://paste.sr.ht/$srht_user/$hash"
string trim $url | wl-copy
echo "$url copied to clipboard."
case '*' case '*'
echo 'Unhandled case!' echo 'Unhandled case!'
# echo ">$cmd<"
false false
return return
end end