Xfce Forum

Sub domains
 

You are not logged in.

#1 2007-06-30 23:14:34

blackdisk
Member
Registered: 2006-03-30
Posts: 21

Help with a custom action

I am trying to make a simple custom action for thunar that lets me select files to compress and then select an output file and location to save to.
I have a custom action which just compresses to the directory of the selected files with a progress notification (or at least a notification, it doesn't seem to progress too well).

7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on %n.7z %N | zenity --progress --text=Compressing --percentage=0 --auto-kill

Now as a custom action to select the output file

zenity --file-selection --filename=%f.7z --save --confirm-overwrite && 7za a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=on %d/%n.7z %N | zenity --progress --text=Compressing --percentage=0 --auto-kill

This naturally doesn't work right, it just runs the zenity file selection, and the actual compression as unrelated commands.

Is there a simple way to link these two in one line, like with a command, so it can be used for the custom action?

Offline

#2 2007-07-01 09:01:48

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,143
Website

Re: Help with a custom action

Why don't you put this in a bash script?

Offline

#3 2007-07-02 08:44:06

blackdisk
Member
Registered: 2006-03-30
Posts: 21

Re: Help with a custom action

I thought of that but I'm not too experienced with bash scripts either so how could I reference the %F in a script to what thunar is doing?

Offline

#4 2007-07-02 14:48:35

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,143
Website

Re: Help with a custom action

Small sample:

[code=test.sh]
#!/bin/bash

echo "$1"
echo "$2"
[/code]

Then add the following command in thunar-uca:
[code]test.sh '%F' '%N'[/code]

Offline

#5 2007-07-06 03:33:38

blackdisk
Member
Registered: 2006-03-30
Posts: 21

Re: Help with a custom action

I don't understand, you mean add it to thunar-uca.la ?

Offline

#6 2007-07-07 08:37:50

Nick
Dev
From: ~
Registered: 2005-02-17
Posts: 1,143
Website

Re: Help with a custom action

No, add this command in the custom actions editor, that uses the bash script.

Offline

Board footer

Powered by FluxBB