Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionNext revisionBoth sides next revision | ||
xfce:thunar:custom-actions [2012/12/04 11:13] – created nick | xfce:thunar:custom-actions [2019/07/26 18:57] – Removed uca example xfprint (does that still exist?) with catfish alexxcons | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Custom | + | ====== Custom |
- | Thunar allows users to add custom actions to the file and folder context menus (by the use of the '' | + | 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. | This page serves as an introduction to the **Custom Actions** plugin, and includes a list of useful examples. | ||
- | ===== Adding a custom action | + | ===== 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 '' | 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 '' | + | <figure " |
+ | {{: | ||
+ | </ | ||
+ | |||
+ | On the first page, enter '' | ||
Now, continue with the second page (the {gui> | 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 '' | + | We want to create an action that is only applicable to folders, so select the **Folders** 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. | + | That's all. Click **OK** to close the **Create Action** dialog. The new action, labeled **Search with Catfish** 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. | + | Now close the **Custom Actions** dialog, select a folder |
- | {{ documentation:thunar-custom-actions-3.png }} | + | <figure " |
+ | {{:xfce:thunar:uca-list.png}} | ||
+ | </ | ||
- | You can use the [[http:// | + | ===== Use mnemonics to open Thunar Custom Actions ===== |
+ | |||
+ | When you create a Thunar Custom Action you can set the name with an underscore " | ||
===== Examples ===== | ===== Examples ===== | ||
Line 27: | Line 35: | ||
Here are a few useful examples of custom actions. Feel free to extend this list. | Here are a few useful examples of custom actions. Feel free to extend this list. | ||
- | ==== Finding files in the current folder ==== | + | ==== Finding files in the current folder |
* Name: **Search...** | * Name: **Search...** | ||
* Command: '' | * Command: '' | ||
Line 36: | Line 44: | ||
- | + | ==== Finding files inside | |
- | + | ||
- | + | ||
- | + | ||
- | ==== Finding files in the current | + | |
- | * 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...** | * Name: **Search files inside...** | ||
- | * Command: '' | + | * Command: '' |
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Directories | * Appears if selection contains: Directories | ||
Line 84: | Line 75: | ||
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Directories, | * Appears if selection contains: Directories, | ||
- | |||
* Name: **Enqueue in XMMS** | * Name: **Enqueue in XMMS** | ||
* Command: '' | * Command: '' | ||
Line 113: | Line 103: | ||
**Hint:** '' | **Hint:** '' | ||
- | |||
- | |||
==== Losslessly Rotating JPEGs ==== | ==== Losslessly Rotating JPEGs ==== | ||
Line 122: | Line 110: | ||
* Appears if selection contains: JPEG Image Files | * 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 " | **Note:** jpegtran is available as part of the libjpeg or libjpeg-progs packages of most distributions. Unlike using " | ||
+ | |||
+ | [[https:// | ||
==== Opening a terminal ==== | ==== Opening a terminal ==== | ||
Line 145: | Line 135: | ||
* Appears if selection contains: Directories | * Appears if selection contains: Directories | ||
+ | **Note:** Some distributions no longer include '' | ||
==== Editing as root ==== | ==== Editing as root ==== | ||
* Name: **Edit as root** | * Name: **Edit as root** | ||
Line 151: | Line 142: | ||
* Appears if selection contains: Text files | * 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). | + | **Note:** You'll need to replace put-your-favourite-text-editor-here with your favourite text editor (e.g. mousepad or geany). Also, see previous note about '' |
==== Creating a symbolic link ==== | ==== Creating a symbolic link ==== | ||
Line 166: | Line 157: | ||
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: //any// | * Appears if selection contains: //any// | ||
- | |||
- | |||
==== Setting an image as the desktop background ==== | ==== Setting an image as the desktop background ==== | ||
Line 183: | Line 172: | ||
**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. | **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 ' | + | ==== Using ' |
- | * Command: | + | * Name: **Open in Terminal** |
+ | * Command: | ||
+ | * File pattern: * | ||
+ | * Appearance Conditions: Text files | ||
Since nano isn't a GUI app, you must start it in a terminal window. | Since nano isn't a GUI app, you must start it in a terminal window. | ||
Line 194: | Line 187: | ||
* Appears if selection contains: Directories and Text files | * Appears if selection contains: Directories and Text files | ||
- | **Note:** You will need '' | + | **Note:** You will need the '' |
- | ==== Changing | + | ==== Changing |
**Note:** You will need '' | **Note:** You will need '' | ||
Line 216: | Line 209: | ||
* Appears if selection contains: Video Files | * Appears if selection contains: Video Files | ||
- | **Note:** You will need '' | + | **Note:** You will need '' |
==== Rename subtitles easily ==== | ==== Rename subtitles easily ==== | ||
* Name: **Rename subtitles** | * Name: **Rename subtitles** | ||
Line 224: | Line 217: | ||
* Appears if selection contains: Video Files, Text Files, Other Files | * Appears if selection contains: Video Files, Text Files, Other Files | ||
- | **Note:** You will need '' | + | **Note:** You will need '' |
- | ==== Resize and email images | + | ==== Move files into a new folder |
- | | + | * Name: **Move into new folder** |
- | | + | * Description: |
- | | + | * Command: NEW_FOLDER=$(/usr/bin/ |
- | * Appears if selection contains: Image files | + | * File pattern: * |
- | ** Note:** You will need the script here (which I name thunar-resize-sendto and place in /usr/local/bin), "zenity" | + | |
- | / | + | |
- | \\ | + | |
- | Not sure why this isn't part of Thunar plugins, since it's pretty sweet. Tested on Xubuntu Lucid.\\ | + | |
- | \\ | + | |
- | **NOTE!:** This uses / | + | |
- | < | + | **Note:** You'll will need the '' |
- | # | + | |
- | #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 | ||
- | </ |