LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-11-2018, 06:35 AM   #1
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 140

Rep: Reputation: Disabled
nautilus-actions: is my command correct?


Hi altogether,

What I want to achieve is create a context-menu (rightclick)-entry for scanning files with the clamscan-command.

For ubuntu there is a tool called "nautilus-actions". With it one can create right-click-entries.

The most important settings are under the tab "command".
So I configured it this way:
Code:
path: xterm
parameter: -fa 'Monospace' -fs 12 -hold -e clamscan %f
working directory: %d

The parameter options are thus: -fa 'Monospace' -fs 12 (setting font and font-size)
                              : -hold (preventing xterm from shutting down immediately)
                              : -e (executing the following command within xterm)
                              : clamscan %f ((first) filename)

Actually this works very well.

When right-clicking on the file to be scanned and clicking on the respective label (I called it "Dateiscannen") a separate xterm-window opens and after the scan is
finished the result is displayed until I manually close the xterm-window.

Yet Ive noticed that I can also scan folders with that command (but not recursively of course, due to the very nature of the specified command).

Its always said that everything can be considered to be a file in Linux. So theoeretically a folder is a file as well and therefore the "%f"-parameter should be fine for scanning folders, too.

My question is: Am I right in thinking so or should I use another option than "%f" or folder-scan?

Thanks a lot in advance.

Greetings
Rosika

P.S.:
system: Lubuntu 16.04.5 LTS, 64 bit
 
Old 08-12-2018, 02:21 AM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 8,971
Blog Entries: 5

Rep: Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183Reputation: 2183
Quote:
Originally Posted by Rosika View Post
Its always said that everything can be considered to be a file in Linux. So theoeretically a folder is a file as well and therefore the "%f"-parameter should be fine for scanning folders, too.
does not apply inthis case.
you should read the documentation (probably there are helpful tooltips or a help button) about what parameter to use for a directory.

Quote:
My question is: Am I right in thinking so or should I use another option than "%f" or folder-scan?
yes.
 
Old 08-12-2018, 06:43 AM   #3
Rosika
Member
 
Registered: Apr 2017
Distribution: Lubuntu 64 bit
Posts: 140

Original Poster
Rep: Reputation: Disabled
Hi ondoho,

tnx for your answer.

As far as the parameters for the command are concerned, there are the following (from "parameter legend" for nautilus-actions configuration tool):
Code:
Parameter	Description	

%b	(first) basename			
%B	space-separated list of basenames			
%c	count of selected items			
%d	(first) base directory			
%D	space-separated list of base directory of each selected items			
%f	(first) file name			
%F	space-separated list of selected file names			
%h	hostname of the (first) URI			
%m	mimetype of the (first) selected item			
%M	space-separated list of the mimetypes of the selected items			
%n	username of the (first) URI			
%o	no-op operator which forces a singular form of execution when specified as first parameter			
%O	no-op operator which forces a plural form of execution when specified as first parameter			
%p	port number of the (first) URI			
%s	scheme of the (first) URI			
%u	(first) URI			
%U	space-separated list of selected URIs			
%w	(first) basename without the extension			
%W	space-separated list of basenames without their extension			
%x	(first) extension			
%X	space-separated list of extensions			
%%	the  %  character
Yet Im mot sure what to use for folder-scans:
Code:
parameter: -fa 'Monospace' -fs 12 -hold -e clamscan %d
or
Code:
parameter: -fa 'Monospace' -fs 12 -hold -e clamscan %u
And while its still true that
Code:
parameter: -fa 'Monospace' -fs 12 -hold -e clamscan %f
also works for directories - although not recursively - (as already pointed out) I think theres no harm in using it that way???????

Cheers

Rosika

Last edited by Rosika; 08-12-2018 at 07:02 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax Confusion adding command to Context menus Using Nautilus-Actions Config PatD Linux - Newbie 1 11-21-2017 11:28 AM
nautilus-actions 3.0 and desktop menu alexbib Linux - Newbie 2 12-25-2010 10:40 PM
Nautilus-actions adding new context menu traigo Linux - Software 3 07-09-2009 02:48 PM
LXer: Extending Nautilus context menus with Nautilus-actions LXer Syndicated Linux News 0 10-22-2007 05:30 AM
How to perform root actions in Nautilus? therut Linux - Newbie 2 08-19-2003 07:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration