You are not logged in.

#1 2019-01-13 21:22:15

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

transfer.sh help

Hi Guys,
I am playing with transfer.sh and don't panic  yikes apparently it is going to continue...

Here is the code I have;

live@dwmX:~$ scrot -d 5 ~/screenshots/screenshot.png && curl --upload-file ~/screenshots/screenshot.png https://transfer.sh/screenshot.png
https://transfer.sh/ychDH/screenshot.pnglive@dwmX:~$

I want to automatically open Firefox with the result, in this case, https://transfer.sh/ychDH/screenshot.png

This will be a jgmenu entry to take a scrot after 5 seconds, upload to transfer.sh and open firefox with the result.

Any help much appreciated as usual.

Offline

#2 2019-01-13 22:08:53

damo
....moderator....
Registered: 2015-08-20
Posts: 6,052

Re: transfer.sh help

mrneilypops wrote:

Hi Guys,
I am playing with transfer.sh and don't panic  yikes apparently it is going to continue...

Here is the code I have;

live@dwmX:~$ scrot -d 5 ~/screenshots/screenshot.png && curl --upload-file ~/screenshots/screenshot.png https://transfer.sh/screenshot.png
https://transfer.sh/ychDH/screenshot.pnglive@dwmX:~$

I want to automatically open Firefox with the result, in this case, https://transfer.sh/ychDH/screenshot.png

This will be a jgmenu entry to take a scrot after 5 seconds, upload to transfer.sh and open firefox with the result.

Any help much appreciated as usual.

Add the firefox command to the end?

&& firefox-esr --new-window ~/screenshots/screenshot.png

Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#3 2019-01-14 12:41:13

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

Re: transfer.sh help

@damo
Thanks for your input.
However,I would need Firefox to show the location given from transfer.sh
As you can see transfer.sh gives a unique location for each uploaded file.
For example,

https://transfer.sh/ychDH/screenshot.png

In this case ychDH

Any input most welcome.

Offline

#4 2019-01-14 13:25:47

damo
....moderator....
Registered: 2015-08-20
Posts: 6,052

Re: transfer.sh help

I notice that there is a "log" parameter for the script - if the logfile includes the url used you could extract it and send it to FF.


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#5 2019-01-14 13:38:57

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

Re: transfer.sh help

@damo
Thanks for the input.
I will dig a bit deeper...

Offline

#6 2019-01-14 14:23:26

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,042
Website

Re: transfer.sh help

With transfer function on bottom of transfer.sh page (You probably want to turn this into standalone script in your ~/bin or somewhere on path),

# Add this to .bashrc or its equivalent 
transfer() { if [ $# -eq 0 ]; then echo -e "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"; return 1; fi 
tmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename "$1" | sed -e 's/[^a-zA-Z0-9._-]/-/g'); curl --progress-bar --upload-file "$1" "https://transfer.sh/$basefile" >> $tmpfile; else curl --progress-bar --upload-file "-" "https://transfer.sh/$1" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }

this

firefox $(transfer test.txt)

seems to be working.

Last edited by brontosaurusrex (2019-01-14 14:58:32)

Offline

#7 2019-01-14 16:30:18

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

Re: transfer.sh help

@brontosaurusrex
Thanks for the pointer I now have some success! wink
I added the transfer function to my .bashrc for the moment.

scrot -d 5 /home/live/screenshots/screenshot.png && firefox $(transfer /home/live/screenshots/screenshot.png)

The above works when run in the terminal,uploads file and opens firefox at the correct page.

Next, issue is jgmenu...
I am trying to run this from a jgmenu entry but it does not run.

scrot 5s -> transfer.sh,scrot -d 5 /home/live/screenshots/screenshot.png && firefox $(transfer /home/live/screenshots/screenshot.png),/usr/share/icons/zafiro-icons/apps/scalable/camera.svg

Is there something I am missing from the above command to run in jgmenu?

Offline

#8 2019-01-14 17:24:14

brontosaurusrex
Middle Office
Registered: 2015-09-29
Posts: 2,042
Website

Re: transfer.sh help

Make it a standalone script, bashrc function wont work with anything but bash (or something that can source it correctly). < Guessing that could be a problem.

Last edited by brontosaurusrex (2019-01-14 20:31:18)

Offline

#9 2019-01-15 12:18:19

mrneilypops
The BL Scrot.Moe Guy
From: luxembourg
Registered: 2015-09-30
Posts: 577
Website

Re: transfer.sh help

@brontosaurusrex
I will look further into this.
Thanks for your help.

Offline

Board footer

Powered by FluxBB