AutoYADM commit: 2025-03-29 14:15:07
This commit is contained in:
parent
fc2586d9fb
commit
3fe7111206
1 changed files with 25 additions and 0 deletions
25
.config/fish/functions/pb.fish
Normal file
25
.config/fish/functions/pb.fish
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue