Re: Looking for a generic drag and drop gui for custom commands
Am Tue, 08 Sep 2020 13:40:03 +0100
schrieb Tixy <tixy@yxit.co.uk>:
> > Put the (ffmpeg) command in a script and run it with argument/s ?
>
> And run the script from a 'desktop entry' [1] and your desktop GUI may
> let you run it with file arguments just by dropping files onto it. You
> can put these 'desktop' files on you desktop or in there own directory
> you can open when you have tasks to do.
That ssound like a good idea and close to what I want to achieve, but it
doesn't seem to work in XFCE. When I drop some a file on a desktop file
("starter") that is associated with my testdnd.sh script, the script
doesn't get any input:
----testdnd.sh----
#!/bin/bash
echo 'testdnd.sh'
echo 'First two arguments:'
echo -n '$1: '
echo $1
echo -n '$2: '
echo $2
echo 'Standard Input: '
while read line
do
echo "$line"
done < "${VAR:-/dev/stdin}"
read
----end----
When I drag a text file on the starter / desktop file, the mouse cursor
displays a '+' Symbol, as if the starter accepts that file. But when I
drop it, I get neither parameters nor standard input (that's what I
expect).
----output----
testdnd.sh
First two arguments:
$1:
$2:
Standard Input:
----end----
In contrast, when I call the script from the command line, it gives me
both, parameters and stdin:
----
$ cat test.txt | ./testdnd.sh a b
testdnd.sh
First two arguments:
$1: a
$2: b
Standard Input:
This is
a multiline
text file
----
> The above works for me with LXDE. Though you don't get to edit
> parameters to you scripts, just pass files to them.
It doesn't work for me. Am I doing something wrong?
Anyway, this wouldn't be an optimal solution. In some cases I need to
pass multiple arguments in a specific order. For example an audio and
video file that should be combined into a single .mp4 file.
Christoph
Reply to: