Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #226794

Re: Looking for a generic drag and drop gui for custom commands

From Tixy <tixy@yxit.co.uk>
Newsgroups linux.debian.user
Subject Re: Looking for a generic drag and drop gui for custom commands
Date 2020-09-08 18:50 +0200
Message-ID <AMOYF-681-3@gated-at.bofh.it> (permalink)
References <AMwfn-2fw-7@gated-at.bofh.it> <AMKBI-3wD-13@gated-at.bofh.it> <AMLep-3Jv-1@gated-at.bofh.it> <AMNzz-5kX-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 2020-09-08 at 17:15 +0200, Christoph K. wrote:
[...]
> 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.

It works for me, though I found that multiple files launches multiple
copies of the script, one for each file. To get around that you can use
and explicit %F in the desktop file's Exec command, see [1].

This is what I did to test, including some code to distinguish audio
files from extension. (The 'file' command would probably be best for
testing file type properly, never used this though.)

#------------------------------------------------
~$ cat Desktop/test.desktop 
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=true
Exec=/home/tixy/test.sh %F
Name=Test launcher
Icon=/home/tixy/test.svg

#------------------------------------------------
~$ cat test.sh
#!/bin/bash

if [ -z "$1" ] || [ -z "$2" ]
then
	echo Expected two files
	sleep 2
	exit 1
fi

audiofile=$1
videofile=$2

if [ "${videofile##*.}" = "mp3" ]
then
	# files in wrong order, swap them
	audiofile=$2
	videofile=$1
fi

echo Audio=$audiofile Video=$videofile

sleep 2

#------------------------------------------------
~$ touch audio.mp3
~$ touch video.avi
~$ ./test.sh video.avi audio.mp3
Audio=audio.mp3 Video=video.avi

#------------------------------------------------

If using the GUI file manager I highlight the audio.mp3 and video.avi
files and drag them onto "Test launcher" then I get a terminal window
open up with the same output as I got above using the commandline.

You don't have to rely on the GUIs default terminal. If you set
"Terminal=false" in the .desktop file you can launch your script how
you want, e.g. I've used something...

Exec=lxterminal --geometry=80x30 -e "sh -c /my/script"

To have my preferred terminal at a preferred size,

[1] https://specifications.freedesktop.org/desktop-entry-spec/latest/ar01s07.html

-- 
Tixy

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Looking for a generic drag and drop gui for custom commands "Christoph K." <christoph@kobenetz.de> - 2020-09-07 22:50 +0200
  Re: Looking for a generic drag and drop gui for custom commands David Christensen <dpchrist@holgerdanske.com> - 2020-09-08 12:00 +0200
    Re: Looking for a generic drag and drop gui for custom commands "Christoph K." <christoph@kobenetz.de> - 2020-09-08 14:20 +0200
      Re: Looking for a generic drag and drop gui for custom commands David Christensen <dpchrist@holgerdanske.com> - 2020-09-09 00:40 +0200
  Re: Looking for a generic drag and drop gui for custom commands mick crane <mick.crane@gmail.com> - 2020-09-08 14:10 +0200
    Re: Looking for a generic drag and drop gui for custom commands Tixy <tixy@yxit.co.uk> - 2020-09-08 14:50 +0200
      Re: Looking for a generic drag and drop gui for custom commands Tixy <tixy@yxit.co.uk> - 2020-09-08 15:20 +0200
      Re: Looking for a generic drag and drop gui for custom commands "Christoph K." <christoph@kobenetz.de> - 2020-09-08 17:20 +0200
        Re: Looking for a generic drag and drop gui for custom commands Tixy <tixy@yxit.co.uk> - 2020-09-08 18:50 +0200
          Re: Looking for a generic drag and drop gui for custom commands Tixy <tixy@yxit.co.uk> - 2020-09-08 19:00 +0200
          Re: Looking for a generic drag and drop gui for custom commands "Christoph K." <christoph@kobenetz.de> - 2020-10-13 14:20 +0200
  Re: Looking for a generic drag and drop gui for custom commands Charles Curley <charlescurley@charlescurley.com> - 2020-09-08 20:00 +0200

csiph-web