Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

What is the line parameter in Thunar's "custom actions" that would play a music directory in a Wine (.exe) program?

I want to put Foobar2000 (and possibly other such applications) in Thunar's Custom Actions (actions that can be added/edited to be used in the context menu to play music folder's content).

enter image description here

enter image description here

enter image description here

If I put no command parameter at the end of path, the player opens but there is no play and no files in the play list.

If I add any of the listed parameters I get the error

unknown commandline parameter: /path.to.file

(Giving an answer to this question depends on knowing the CLI command that would have to be added into Thunar - so please look at this question too)

share|improve this question

1 Answer 1

up vote 1 down vote accepted
+100

I think the main problem is that the Thunar command %F is probably not going to work when applied to a Wine program. Often the best way with Thunar custom actions is to use a script and apply the correct parameter to that: i.e.

/home/mike/foo_script %F

then the parameter can apply to the script.

The script I have experimented with is at the hydrogenaudio forums, and I have modified it slightly, but credit to that forum. There is a lot of useful information on that forum about foobar.

#!/bin/bash

cd ~/.wine/drive_c/"Program Files"/foobar2000/
if [ "$1" != "" ]; then
filename=`echo z:$1 | sed 's/\\//\\\\/g'`
wine foobar2000.exe "$filename" &
else
wine foobar2000.exe &
fi

Copy the script into a text editor, but make sure you place the correct location of your foobar directory in the script, make it executable and enter its location in the Thunar custom actions dialogue (as in the screenshot below). As you know, select audio files and folders in the other 'appearance conditions' tab.

enter image description here

Once it has been added as a Thunar custom action with the correct parameters, the script further above allows you to add and then play your music in Foobar just by right clicking on a single track or a folder and selecting your custom menu item.

Here is Foobar launched with the custom action and playing a folder of Duke Ellington:

enter image description here

In addition, you could probably modify the script and also use it for other wine applications just by changing the name (foobar2000) of the application and the application folder. Then you could create a new script and another different custom action.

share|improve this answer
    
works for 7zip too –  cipricus Nov 23 '12 at 16:09

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.