Xfce Forum

Sub domains
 

You are not logged in.

#1 2015-11-19 00:52:01

akovia
Member
Registered: 2011-03-27
Posts: 60

Thunar Custom Action Selections

Hi,
I might be missing something but I can not figure out how to pass "Only" the selected directories either directly or to a bash script. It always seems to grab "All" the directories in the current directory I'm working in.
In this case, it works on all directories even using %d.

<action>
	<icon>/home/akovia/bin/FontRename4/FontRename4_48x.png</icon>
	<name>FontRename4</name>
	<unique-id>1447892031263855-26</unique-id>
	<command>terminator --profile stayopen --geometry 1280x720+820+150 --borderless -x  java -jar /home/akovia/bin/FontRename4.jar  -h1 -m3 -s %d | tee -a fontrename4.log</command>
	<description>Rename Fonts </description>
	<patterns>*</patterns>
	<directories/>
</action>

Also,
I am having a hard time following the logic of how these commands flow as I can't seem to send stdout to both the terminal and to a log file. I tried using ">>" before piping with tee, but in both cases it creates an empty file.

Lastly,
not sure if it's possible, but I would also like to be able to work on only selected Directories OR selected files with the same CA.

Help with any of these would be greatly appreciated.


Arch Linux

Offline

#2 2015-11-19 01:47:20

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Thunar Custom Action Selections

akovia wrote:

Hi,
I might be missing something but I can not figure out how to pass "Only" the selected directories either directly or to a bash script. It always seems to grab "All" the directories in the current directory I'm working in.
In this case, it works on all directories even using %d.

Use %F to get only the selected directories.

Also,
I am having a hard time following the logic of how these commands flow as I can't seem to send stdout to both the terminal and to a log file. I tried using ">>" before piping with tee, but in both cases it creates an empty file.

I can't get the tee to work either. I'll see if I can figure out why.

Lastly,
not sure if it's possible, but I would also like to be able to work on only selected Directories OR selected files with the same CA.

%F will do this provided that you select all of the check boxes in the "Appearance Conditions" tab and set "File Pattern" to "*"

Consider the following example:

<action>
	<icon></icon>
	<name>dir par test</name>
	<unique-id>1447895896531597-7</unique-id>
	<command>/home/toz/Downloads/tmp/ca %F</command>
	<description>dir par test</description>
	<patterns>*</patterns>
	<directories/>
	<audio-files/>
	<image-files/>
	<other-files/>
	<text-files/>
	<video-files/>
</action>

...where the ca executable contains:

#!/bin/bash

for par in $@
do
	echo "$par" >> /tmp/par.log
done

This will print out all the selected files and directories.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2015-11-19 03:21:08

akovia
Member
Registered: 2011-03-27
Posts: 60

Re: Thunar Custom Action Selections

Thank you so much ToZ!

I'm eager to hear if you come up with anything on the tee problem, but you've already been infinitely helpful.

Cheers


Arch Linux

Offline

Board footer

Powered by FluxBB