Remix.run Logo
Imustaskforhelp 4 days ago

I had a lot of pdfs and so a single drag and drop of web would've made more sense and in fact initially I thought of some golang tool that is just a simple http wrapper over the cli too.

lelanthran 4 days ago | parent [-]

> I had a lot of pdfs and so a single drag and drop of web would've made more sense and in fact initially I thought of some golang tool that is just a simple http wrapper over the cli too.

Depending in your file manager, drag and drop might work on shell scripts too. Even multiple files.

TBH, when I last needed something like that I simply called zenity from my shell script.

Imustaskforhelp 4 days ago | parent [-]

Hm I didn't know drag and drop could work on shell scripts too!

That's something new!!

OHHH that's actually really cool to have zenity, Wow. I didn't know about this...

Is this thing cross platform? I like it if you are saying that it would open up a drag and drop box and then merge the pdf's

Definitely a bit harder than what I had cooked but I respect it, I might use zenity or some gui-esque option to convert cli's into gui of sorts y'know..

But my tool is just some lines of golang which can be go mod init go mod tidy go run . and it would open up localhost port and can even be accessed through other devices on the same network but your thing is really cool too

Can you though please share me the shell scripts or something so that I don't have to write the shell scripts when I need in the time of need y'know?

Like your approach is nice too and something to know in the back of my mind too

lelanthran 4 days ago | parent [-]

> Hm I didn't know drag and drop could work on shell scripts too!

Depends on the file manager. I use Caja which is fairly ancient, and supports this, so I expect newer file managers to support it too.

For PDFs, something like this might work (note: not tested)

     #!/bin/bash

     pdftk $@ cat output output.pdf verbose &> /tmp/output

> that's actually really cool to have zenity, Wow. I didn't know about this...

> Is this thing cross platform? I like it if you are saying that it would open up a drag and drop box and then merge the pdf's

Not sure if zenity is x-platform; what I did do once when I needed to select multiple files was have the shell script sit in a loop calling zenity, appending filenames to a variable, and then display a confirmation with a "Process" button before performing the actual processing.

ISTR using zenity for display the file selection dialogs, the confirmation dialog and a progress indicator while processing.

> But my tool is just some lines of golang which can be go mod init go mod tidy go run . and it would open up localhost port and can even be accessed through other devices on the same network but your thing is really cool too

Yeah, I just needed something temporarily for the operators to use during a build process. Wasn't going to need network access, nor did I want to add in a new dependency by using Python or something.