AutoYADM commit: 2025-03-29 14:30:07
This commit is contained in:
parent
3fe7111206
commit
1c117017d3
1 changed files with 19 additions and 2 deletions
|
@ -14,8 +14,25 @@ function pb --description 'Upload a paste to sr.ht'
|
||||||
echo "$url copied to clipboard."
|
echo "$url copied to clipboard."
|
||||||
|
|
||||||
case copy
|
case copy
|
||||||
set -l lines (string split \n (hut paste list))
|
set -l lines (string split \n (hut paste list) | string trim | string match -rv '^$')
|
||||||
echo $lines
|
if test (count $lines) -le 1
|
||||||
|
echo 'No pastes found!'
|
||||||
|
false
|
||||||
|
return
|
||||||
|
end
|
||||||
|
for i in (seq 1 2 (count $lines))
|
||||||
|
set -l meta $lines[$i]
|
||||||
|
set -l filename $lines[(math $i + 1)]
|
||||||
|
set -l append "$filename: $meta"
|
||||||
|
if not set -q list
|
||||||
|
set --function list $append
|
||||||
|
else
|
||||||
|
set --function list $list $append
|
||||||
|
end
|
||||||
|
end
|
||||||
|
printf '%s\n' $list
|
||||||
|
set -l selection (echo $list | fzf)
|
||||||
|
echo $selection
|
||||||
case '*'
|
case '*'
|
||||||
echo 'Unhandled case!'
|
echo 'Unhandled case!'
|
||||||
# echo ">$cmd<"
|
# echo ">$cmd<"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue