Jonnan001
Posts: 7
Joined: Sat May 14, 2016 3:16 pm

Exec and Desktop Shortcuts

Sun Sep 25, 2016 10:23 pm

I have obviously forgotten and cannot find *something* fundamental about the way exec interacts with desktop shortcuts and parameters.

If I run the line

Code: Select all

avconv -i Wasteland.wav  Wasteland.flac
it parses and converts the wav file to flac like a champ.

If I create the file association

Code: Select all

[Desktop Entry]
Type=Application
Name=avconv wav2flac
Exec=avconv -i %f %f.flac
Categories=Other;
NoDisplay=true
MimeType=audio/x-wav
Terminal=true
X-KeepTerminal=false
and run that on Wasteland.wav, what I feel I should get is Wasteland.wav.flac.

What I *actually* get is it ignores the .flac suffix and tries to overwrite my original file:

Code: Select all

avconv version 11.7-6:11.7-1~deb8u1+rpi1, Copyright (c) 2000-2016 the Libav developers
  built on Jun 17 2016 02:13:49 with gcc 4.9.2 (Raspbian 4.9.2-10)
[wav @ 0x280c80] max_analyze_duration 5000000 reached
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, wav, from '/home/pi/Desktop/Wasteland.wav':
  Metadata:
    encoded_by      : Logic Pro
    date            : 2012-10-08
    creation_time   : 09:22:02
    time_reference  : 172828800
    umid            : 0x006D742018000000300000002099BF5FFF7F00005098BF5FFF7F0000427269610x6E205B530000000000000000A7ABAA32000000000000000000000000000000
    coding_history  : 
  Duration: 00:05:00.00, bitrate: 2304 kb/s
    Stream #0.0: Audio: pcm_s24le, 48000 Hz, 2 channels, s32, 2304 kb/s
File '/home/pi/Desktop/Wasteland.wav' already exists. Overwrite ? [y/N] 
I moved the file to my Desktop to eliminate spaces in the path as an issue.
Changing the output explicitly to '/home/pi/Desktop/Wasteland.flac' fails out completely (Terminal flickers/dies and that certainly seems like it should work.).
Quoting the %f.flac with quotes or doublequotes, terminal flickers/dies.
Exec=lxterminal -e avconv -i %f %f.flac successfully spawns a second terminal with the exact same result as the first one and varying the parameters has the same results as no lxterminal -e at all.

and just to keep it annoying the 'Keep terminal window open after command execution' option (aka X-KeepTerminal=true) doesn't seem to actually have any effect on either a working or a crashing variation. So that's a bug.

I'm sure I'm missing something obvious about how exec passes through commands, but I know not what? My next step is going to be a bash script and run *that* from exec but even if that's necessary I'd like to know *why* it's necessary?

Return to “Advanced users”