no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | xfce:thunar:4.10:custom-actions [2015/03/11 13:50] (current) – created ochosi | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Custom actions ====== | ||
| + | Thunar allows users to add custom actions to the file and folder context menus (by the use of the '' | ||
| + | |||
| + | This page serves as an introduction to the **Custom Actions** plugin, and includes a list of useful examples. | ||
| + | |||
| + | ===== Adding a custom action ===== | ||
| + | |||
| + | This section provides a step-by-step introduction to the **Custom Actions** plugin, demonstrating how to add a **Print File** action, which uses xfprint to print text files. We start by opening the **Custom Actions** dialog as explained above. In the dialog, click on the first button in the list of buttons (the one labeled with the '' | ||
| + | |||
| + | On the first page, enter '' | ||
| + | |||
| + | Now, continue with the second page (the {gui> | ||
| + | |||
| + | We want to create an action that is only applicable to text files, so select the **Text Files** options and unselect the options for the other file types. Next you can specify a **File Pattern** to display the action only for text files that match a certain pattern. In the example, we set the file pattern to '' | ||
| + | |||
| + | That's all. Click **OK** to close the **Create Action** dialog. The new action, labeled **Print File** will appear in the **Custom Actions** list. | ||
| + | |||
| + | Now close the **Custom Actions** dialog, select a text file in Thunar and open the context menu (right-click on the file icon). The newly created **Print File** action will appear in the context menu, as shown in the screenshot below. | ||
| + | |||
| + | {{ documentation: | ||
| + | |||
| + | You can use the [[http:// | ||
| + | |||
| + | ===== Examples ===== | ||
| + | |||
| + | Here are a few useful examples of custom actions. Feel free to extend this list. | ||
| + | |||
| + | ==== Finding files in the current folder ==== | ||
| + | * Name: **Search...** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | **Note:** For this action, you'll need to have '' | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==== Finding files in the current folder with catfish ==== | ||
| + | * Name: **Search files...** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | **Note:** For this action, you'll need to have '' | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | ==== Finding files inside the selected folder with catfish ==== | ||
| + | * Name: **Search files inside...** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | **Note:** For this action, you'll need to have '' | ||
| + | |||
| + | ==== Working with archives | ||
| + | * Name: **Extract here (bzip2)** | ||
| + | * Command: '' | ||
| + | * File pattern: *.tar.bz2; | ||
| + | * Appears if selection contains: Other Files | ||
| + | |||
| + | * Name: **Extract here (zip)** | ||
| + | * Command: '' | ||
| + | * File pattern: *.zip | ||
| + | * Appears if selection contains: Other Files | ||
| + | |||
| + | * Name: **Create tar.gz from folder** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | **Hint:** You may prefer the [[http:// | ||
| + | |||
| + | ==== Playing music files ==== | ||
| + | * Name: **Play with XMMS** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories, | ||
| + | |||
| + | * Name: **Enqueue in XMMS** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories, | ||
| + | |||
| + | **Hint:** Works exactly the same with Audacious. | ||
| + | |||
| + | ==== Burning an ISO file to a CD ==== | ||
| + | * Name: **Burn with K3B** | ||
| + | * Command: '' | ||
| + | * File pattern: *.iso | ||
| + | * Appears if selection contains: Other Files | ||
| + | |||
| + | ==== Viewing images ==== | ||
| + | * Name: **View with GQview** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories, | ||
| + | **Note:** This tip also works just as well with GThumb | ||
| + | |||
| + | |||
| + | ==== Converting PNGs to JPEGs ==== | ||
| + | * Name: **To JPEG** | ||
| + | * Command: '' | ||
| + | * File pattern: *.png | ||
| + | * Appears if selection contains: Image Files | ||
| + | |||
| + | **Hint:** '' | ||
| + | |||
| + | |||
| + | |||
| + | ==== Losslessly Rotating JPEGs ==== | ||
| + | * Name: **Rotate Clockwise** | ||
| + | * Command: '' | ||
| + | * File pattern: *.jpg; | ||
| + | * Appears if selection contains: JPEG Image Files | ||
| + | **Note:** jpegtran is available as part of the libjpeg or libjpeg-progs packages of most distributions. Unlike using " | ||
| + | |||
| + | ==== Opening a terminal ==== | ||
| + | * Name: **Open in a terminal** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | **Note:** You might need to type '' | ||
| + | |||
| + | ==== Opening a root terminal ==== | ||
| + | * Name: **Open a root terminal here** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | **Note:** You should rewrite the command with normal straight quotes. | ||
| + | |||
| + | ==== Opening a root Thunar ==== | ||
| + | * Name: **Open a root Thunar here** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories | ||
| + | |||
| + | ==== Editing as root ==== | ||
| + | * Name: **Edit as root** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Text files | ||
| + | |||
| + | **Note:** You'll need to replace put-your-favourite-text-editor-here with your favourite text editor (e.g. mousepad or geany). | ||
| + | |||
| + | ==== Creating a symbolic link ==== | ||
| + | * Name: **Create symlink** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories, | ||
| + | |||
| + | ==== Saving the selected file/ | ||
| + | For fans of the Windows " | ||
| + | * Name: **Copy Pathname to Clipboard** | ||
| + | * Description: | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: //any// | ||
| + | |||
| + | |||
| + | |||
| + | ==== Setting an image as the desktop background ==== | ||
| + | * Name: **Set as desktop background** | ||
| + | * Command:< | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Image Files | ||
| + | |||
| + | ==== Viewing the disk usage of the current directory ==== | ||
| + | * Name: **Disk Usage** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Tick all the boxes | ||
| + | |||
| + | **Note:** The idea is to get a visual picture of the current directory and any subdirectories. You could also use fsview or filelight, but the visuals are crisper in baobab. | ||
| + | |||
| + | ==== Using ' | ||
| + | * Command: '' | ||
| + | |||
| + | Since nano isn't a GUI app, you must start it in a terminal window. | ||
| + | |||
| + | ==== Comparing selected files/ | ||
| + | * Name: **Compare** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Directories and Text files | ||
| + | |||
| + | **Note:** You will need '' | ||
| + | |||
| + | ==== Changing OpenOffice.org supported formats ==== | ||
| + | **Note:** You will need '' | ||
| + | |||
| + | * Name: **Convert to ODT** | ||
| + | * Command: '' | ||
| + | * File pattern: *.doc; | ||
| + | * Appears if selection contains: Other files | ||
| + | |||
| + | * Name: **Export to PDF** | ||
| + | * Command: '' | ||
| + | * File pattern: *.doc; | ||
| + | * Appears if selection contains: Other files | ||
| + | |||
| + | You can go on, try '' | ||
| + | ==== Download subtitles with periscope ==== | ||
| + | * Name: **Download subtitles** | ||
| + | * Command: '' | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Video Files | ||
| + | |||
| + | **Note:** You will need '' | ||
| + | ==== Rename subtitles easily ==== | ||
| + | * Name: **Rename subtitles** | ||
| + | * Description: | ||
| + | * Command: '' | ||
| + | * File pattern: *.avi; | ||
| + | * Appears if selection contains: Video Files, Text Files, Other Files | ||
| + | |||
| + | **Note:** You will need '' | ||
| + | |||
| + | ==== Resize and email images ==== | ||
| + | * Name: **Resize Images then email them** | ||
| + | * Description: | ||
| + | * File pattern: * | ||
| + | * Appears if selection contains: Image files | ||
| + | ** Note:** You will need the script here (which I name thunar-resize-sendto and place in / | ||
| + | / | ||
| + | \\ | ||
| + | Not sure why this isn't part of Thunar plugins, since it's pretty sweet. Tested on Xubuntu Lucid.\\ | ||
| + | \\ | ||
| + | **NOTE!:** This uses / | ||
| + | |||
| + | < | ||
| + | #!/bin/bash | ||
| + | #input to this is a list of files to send. | ||
| + | # depends on thunar, ImageMagick and Zenity | ||
| + | TMP=/ | ||
| + | LOG=/ | ||
| + | MARKER=/ | ||
| + | SENDTO="/ | ||
| + | SIZES=" | ||
| + | DISCMD=" | ||
| + | # Find unused tmp dir | ||
| + | if [ -e $MARKER ]; then | ||
| + | CUR=$(cat $MARKER) | ||
| + | else | ||
| + | CUR=1 | ||
| + | fi | ||
| + | if [ 1 == $CUR ]; then | ||
| + | CUR=0 | ||
| + | else | ||
| + | CUR=1 | ||
| + | fi | ||
| + | echo " | ||
| + | TEMP=" | ||
| + | mkdir -p $TEMP | ||
| + | rm -rf $TEMP/* | ||
| + | |||
| + | for s in $SIZES; do | ||
| + | if [ -z $COLS ]; then | ||
| + | COLS=" | ||
| + | else | ||
| + | COLS=" | ||
| + | fi | ||
| + | done | ||
| + | SIZE=$($DISCMD $COLS) | ||
| + | echo " | ||
| + | |||
| + | for f in " | ||
| + | n=$(basename " | ||
| + | echo "item ' | ||
| + | convert $f -resize $SIZE " | ||
| + | FILES=" | ||
| + | done | ||
| + | $SENDTO $FILES | ||
| + | </ | ||