Page 1 of 1

Thunar custom action

Posted: Wed 13 Jul 2016, 20:36
by scientist
Trying to make a thunar custom action that zips files.

This is not working.

Anyone know why ?

Code: Select all

zip -u %f

Posted: Fri 15 Jul 2016, 04:09
by april
Nobody else so %f is that file ? So whatever file it finds addressed in f.
So is there a file at f when you test it? Does Thunar have say a right click menu in each window that loads the selected file into %f

I think rox uses "$@" to a terminal but
From Rox help wrote: System(Command) executes `Command' on the file. The test succeeds if the command returns an exit status of zero. A `%' character in `Command' is replaced by the full path of the file being checked. System is a very slow test to perform, so do it last if possible. For example, if you're looking for a `.c' file containing the word `main', do:

'*.c' system(grep -q main "%")

so that the grep is only performed for files ending in `.c' (as opposed to only checking that the file ends in `.c' if it contains the word `main').
Just messing

Code: Select all

# zip -u %f
	zip warning: %f.zip not found or empty
# zip -u %
	zip warning: %.zip not found or empty
# zip -u $@

zip error: Invalid command arguments (cannot write zip file to terminal)
# zip -u "%"
	zip warning: %.zip not found or empty
# zip -u "%f"
	zip warning: %f.zip not found or empty
# 

Posted: Fri 15 Jul 2016, 14:21
by scientist
Thanks April for responding.

The reason why your code failed is because you have to use thunar customized actions for it to work.

Thunar is in the Puppy Package Manager.

This is what I ended up with.

Code: Select all

zip -u -j %n.zip %F
%F is the selected file(s)

%n is name of first selected file

-j does not zip up directories, only the file(s) selected

-u update Only adds new or updated files