Custom Action Scripts

A Custom action are the actions of the right-click context menu. They are simple to make and just about every linux file manager has a way of allowing the user to create them. The basic thing you need to add to the scripts will be things like name , description. The command you run is also relatively simple and when it will appear in the menu.

This is an example of the configuration for opening a terminal in the current location via right click:
Name = Open terminal here
Description = Open terminal here
Command = exo-open –working-directory %f –launch TerminalEmulator (note you may need to change this to your terminal emulator)
Icon = /usr/share/icons/gnome/32×32/actions/view-restore.png
Appearance Conditions
*
Contains = Directories
Name , Descritpion and icon are relatively unimportant however the %f is vital , there is difference between that and %F

%f = The path to the first selected file
%F = The path to all the selected files
%d = The directory containing the file passed in %f
%D = The directories containing the files passed in %F
%n = The first selected filename (without path)
%N = The selected filenames (without paths)

The appearance Conditions determine on what does the menu item appear. Here are some more examples , please note that in order some of these to work extra programs had to be installed first ie fuseiso.

Name = Mount Iso
Description = Mount The Selected Iso
Command = fuseiso -n -p %f %f.mount
Icon = /usr/share/icons/gnome/32×32/actions/view-restore.png
Appearance Conditions
*.iso;*.ISO;*.bin;*.BIN;*.nrg;*.NRG;*.mdf;*.MDF
Contains = other

Name = Unmount ISO
Description = Unmount a mounted ISO
Command = fusermount -u %f && rmdir %d
Icon = /usr/share/icons/gnome/32×32/actions/view-restore.png
Appearance Conditions
*.mount
Contains = Directories

Name = Open as Root
Description = Open as Root
Command = gksudo thunar %f
Icon = N/A (havent used one for this , but you can select your own)
Appearance Conditions
*
Contains = Directories, Text, Other

Name = Check md5sum
Description = Check md5sum
Command = zenity –info –title=”Check md5 for %n” –text=”$(md5sum %f)”
Icon = N/A (havent used one for this , but you can select your own)
Appearance Conditions
*.iso;*.ISO;*.bin;*.BIN;*.nrg;*.NRG;*.mdf;*.MDF
Contains = Other

Name = Pastebinit
Description = Pastebinit
Command = zenity –info –title=”Pastebinit %n” –text=”$(pastebinit %f)”
Icon = N/A (havent used one for this , but you can select your own)
Appearance Conditions
*
Contains = Text

Name = Convert to AVI
Description = Convert to AVI
Command = xfce4-terminal -x ffmpeg -i %f -b 798k -ab 128k %f.avi
Icon = N/A (havent used one for this , but you can select your own)
Appearance Conditions
*
Contains = Video

Advertisements
Tagged with:
Posted in 01Ben, Uncategorized
2 comments on “Custom Action Scripts
  1. […] (optional). It can be downloaded from here.I have a modified (by me) that can be used as a thunar action script available for download, it can be modified to use zenity if youd prefer that. Once downloaded make […]

  2. […] with the script every time you wanted to encrypt a file , so an easy solution would be use a custom action script for whichever file manager your using […]

Please feel free to leave a reply.

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Archives
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 69 other followers

%d bloggers like this: