Pages

Monday, 11 March 2013

Custom action for Thunar!


Thunar is a very powerful file manager, that comes with XFCE desktop environment. It is very flexible and give to the user the possibilities to define such "custom action", with which is easier do some kind of action very rapidly, with just one click! Let see in detail...
To define a new custom action, just open Thunar and go in Edit-->Configure custom action. Then we can see that from default there are already two very helpful custom actions, "open terminal here" and "search in the directory". To add other custom actions, let click in plus sign (of course...), then a new window will open, and we can define whatever actions we want.

Open as root

Open a directory with root permission:
Name: Open as root
Description: Open the folder as root
Command: gksu thunar %f
Image: for example an icon folder
We can choose whatever we want for image...

Then in the other tab:
File pattern: *
Appears if selection cointains: Directories

Open and edit as root

Open a text file to edit with root permission:
Name: Open and edit as root
Description: Open text and edit it as root
Command: gksu mousepad %n
#You can change the text editor if you want
File pattern: *
Appears if selection cointains: Text files

Create a symbolic link

Create a symbolic link in which dicìrectory we prefer:
Name: Create a symbolic link
Description: Create a symbolic link in the wanted directory
Command: dest=`zenity --file-selection --directory``echo /`%n;  ln -s %f "$dest"
File pattern: *
Appears if selection cointains: Select all file types

Md5 calculation

Open a text file to edit with root permission:
Name: MD5SUM Calculation
Description: md5 sum calculation for image disk
Command: zenity --info --title="MD5SUM for %n" --text="$(md5sum %f)"
File pattern: *.iso;*.usb;*.img
Appears if selection cointains: Other files

Print text and image directly

Open a text file to edit with root permission:
Name: Print
Description: Print text or image
Command: lp %f
File pattern: *
Appears if selection cointains: Text files, Image files

No comments:

Post a Comment