You are not logged in.
Pages: 1
Hi Guys,
I am playing with transfer.sh and don't panic 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
Hi Guys,
I am playing with transfer.sh and don't panicapparently 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
@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
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
@damo
Thanks for the input.
I will dig a bit deeper...
Offline
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
@brontosaurusrex
Thanks for the pointer I now have some success!
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
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
@brontosaurusrex
I will look further into this.
Thanks for your help.
Offline
Pages: 1