mirror of
https://github.com/eoli3n/dotfiles
synced 2024-11-22 23:12:32 +01:00
up updated
This commit is contained in:
parent
c39e9afa5a
commit
940f1ab099
@ -1,3 +1,4 @@
|
|||||||
function up
|
function up
|
||||||
~/bin/up $argv;
|
$HOME/bin/up ;
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
function upfile
|
|
||||||
curl -F "file=@$argv" https://x0.at/
|
|
||||||
end
|
|
@ -1,36 +0,0 @@
|
|||||||
#!/usr/bin/fish
|
|
||||||
|
|
||||||
# base : https://github.com/fish-shell/fish-shell/issues/939#issuecomment-22058614
|
|
||||||
|
|
||||||
# upload image : up file.png
|
|
||||||
# upload piped data : cat file.txt | up
|
|
||||||
# upload clipboard : up
|
|
||||||
# validation : if clipboard then open vim to valid or edit
|
|
||||||
# wq = ok, q = abort
|
|
||||||
# catch url : middle clic to paste url
|
|
||||||
|
|
||||||
|
|
||||||
function uptest --description 'Upload datas'
|
|
||||||
|
|
||||||
# Set commands
|
|
||||||
set clipboard_copy wl-copy
|
|
||||||
set clipboard_paste wl-paste
|
|
||||||
|
|
||||||
# If filename as argument
|
|
||||||
if isatty stdin
|
|
||||||
echo "Upload $argv"
|
|
||||||
# Upload img to x0.at because ix.io fails to set filetype
|
|
||||||
curl -F "file=@$argv" https://x0.at/ | read -l url
|
|
||||||
# Else pipe data
|
|
||||||
else
|
|
||||||
echo "Upload pipe"
|
|
||||||
# Upload text to ix
|
|
||||||
cat - | curl -F 'f:1=<-' 'http://ix.io' | read -l url
|
|
||||||
end
|
|
||||||
|
|
||||||
echo $url
|
|
||||||
# Auto copy
|
|
||||||
#if which $clipboard_copy &> /dev/null
|
|
||||||
# echo $url | $clipboard_copy
|
|
||||||
#end
|
|
||||||
end
|
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
- name: install ix.io up in in home/bin
|
- name: install ix.io up in in home/bin
|
||||||
shell: |
|
shell: |
|
||||||
curl ix.io/client > ~/bin/up
|
curl https://gist.githubusercontent.com/eoli3n/422afffb4801b7419233c232e2843887/raw/f07e3db3658810e6cdafd6352b56c9d1c4ae971b/up > ~/bin/up
|
||||||
chmod +x ~/bin/up
|
chmod +x ~/bin/up
|
||||||
args:
|
args:
|
||||||
creates: ~/bin/up
|
creates: ~/bin/up
|
||||||
|
Loading…
Reference in New Issue
Block a user