Thunar custom action

Using applications, configuring, problems
Post Reply
Message
Author
scientist
Posts: 860
Joined: Sat 23 May 2015, 08:21

Thunar custom action

#1 Post 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
Thanks,
Andy


Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar

april

#2 Post 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
# 

scientist
Posts: 860
Joined: Sat 23 May 2015, 08:21

#3 Post 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
Thanks,
Andy


Slacko 6.3.0 FULL INSTALL
JWM
File Manager - Thunar

Post Reply