Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
xfce:thunar:custom-actions [2018/11/27 21:27] – [Using 'nano' text editor in a terminal] alexxcons | xfce:thunar:custom-actions [2024/01/07 12:47] – [Open thunar as root here] alexxcons | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Custom Actions ====== | + | ~~NOTOC~~ |
+ | {{ : | ||
+ | ====== | ||
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]]** | ||
+ | * **[[#Using mnemonics to open Custom Actions|Using mnemonics to open Custom Actions]]** | ||
+ | * **Examples** | ||
+ | * **[[#Search files with catfish|Search files with catfish]]** | ||
+ | * **[[#Work with archives (tar, gzip, etc)|Work with archives (tar, gzip, etc)]]** | ||
+ | * **[[# | ||
+ | * **[[# | ||
+ | * **[[#Rotate JPEGs|Rotate JPEGs]]** | ||
+ | * **[[#Open terminal here|Open terminal here]]** | ||
+ | * **[[#Open root terminal here|Open root terminal here]]** | ||
+ | * **[[#Open thunar as root here|Open thunar as root here]]** | ||
+ | * **[[#Edit file as root|Edit file as root]]** | ||
+ | * **[[#Create a symbolic link|Create a symbolic link]]** | ||
+ | * **[[#Create a hardlink|Create a hardlink]]** | ||
+ | * **[[#View disk usage of the current directory|View disk usage of the current directory]]** | ||
+ | * **[[#Open file in terminal text editor|Open file in terminal text editor]]** | ||
+ | * **[[# | ||
+ | * **[[#Change OpenDocument-supported formats|Change OpenDocument-supported formats]]** | ||
+ | * **[[# | ||
+ | * **[[#Rename subtitles easily|Rename subtitles easily]]** | ||
+ | * **[[#Move files into a new folder|Move files into a new folder]]** | ||
+ | * **[[#Create Shared Thumbnails|Create Shared Thumbnails]]** | ||
+ | * **[[#Use 'bulk rename' | ||
+ | * **[[#Trust multiple desktop files at once|Trust multiple desktop files at once]]** | ||
+ | * **[[https:// | ||
+ | |||
+ | ---- | ||
===== 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** | + | This section provides a step-by-step introduction to the **Custom Actions** plugin, demonstrating how to add a simple |
<figure " | <figure " | ||
- | {{: | + | {{: |
</ | </ | ||
- | On the first page, enter '' | + | On the first page, enter '' |
+ | |||
+ | Optionally, you can specify a {gui> | ||
+ | |||
+ | < | ||
+ | |||
+ | Always quote shell variable expansions, unless you know why [classical shell programming advice, but it might be useful | ||
+ | |||
+ | When a field code appears | ||
+ | cmd "foo %f bar" | ||
+ | |||
+ | Or you can put its content in a shell variable and use this variable instead: | ||
+ | cmd "foo %f bar" (wrong) ->; f=%f; cmd "foo $f bar" (correct) | ||
+ | |||
+ | In case of multiple arguments, you can safely use a for loop in that way: | ||
+ | for f in %F; do cmd "foo $f bar"; done | ||
+ | </ | ||
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 |
<figure " | <figure " | ||
- | {{thunar:thunar_custom-actions-dialog.png}} | + | {{:xfce:thunar:uca-list.png}} |
</ | </ | ||
- | ===== Use mnemonics to open Thunar | + | [[|Back to Top]] |
+ | ---- | ||
+ | |||
+ | ===== Using mnemonics to open Custom Actions ===== | ||
When you create a Thunar Custom Action you can set the name with an underscore " | When you create a Thunar Custom Action you can set the name with an underscore " | ||
+ | ---- | ||
===== Examples ===== | ===== Examples ===== | ||
Line 35: | Line 85: | ||
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 ==== | ||
- | * Name: **Search...** | ||
- | * Command: '' | ||
- | * File pattern: * | ||
- | * Appears if selection contains: Directories | ||
- | **Note:** For this action, you'll need to have '' | + | ==== Search |
- | + | * Name: **Search files in folder** | |
- | ==== Finding | + | * Command: '' |
- | * Name: **Search files...** | + | |
- | * Command: '' | + | |
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Directories | * Appears if selection contains: Directories | ||
Line 51: | Line 94: | ||
**Note:** For this action, you'll need to have '' | **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 | + | ==== Work with archives |
* Name: **Extract here (bzip2)** | * Name: **Extract here (bzip2)** | ||
* Command: '' | * Command: '' | ||
Line 75: | Line 112: | ||
* Appears if selection contains: Directories | * Appears if selection contains: Directories | ||
- | **Hint:** You may prefer the [[http://thunar.xfce.org/plugins.html# | + | **Hint:** You may prefer the [[https://docs.xfce.org/xfce/thunar/archive|Thunar Archive Plugin]], which does pretty much the same thing with less manual setup required on your part. It's either included with your distribution (in the case of [[https:// |
- | ==== Playing | + | ---- |
+ | |||
+ | ==== Play/ | ||
* Name: **Play with XMMS** | * Name: **Play with XMMS** | ||
* Command: '' | * Command: '' | ||
Line 89: | Line 128: | ||
**Hint:** Works exactly the same with Audacious. | **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 | ||
- | + | ==== Convert | |
- | ==== Converting | + | * Name: **Convert to JPEG** |
- | * Name: **To JPEG** | + | |
* Command: '' | * Command: '' | ||
* File pattern: *.png | * File pattern: *.png | ||
* Appears if selection contains: Image Files | * Appears if selection contains: Image Files | ||
- | **Hint:** '' | + | **Hint:** '' |
- | ==== Losslessly Rotating | + | ---- |
+ | |||
+ | ==== Rotate | ||
* Name: **Rotate Clockwise** | * Name: **Rotate Clockwise** | ||
- | * Command: '' | + | |
+ | | ||
+ | * Command(counterclockwise): ''< | ||
* File pattern: *.jpg; | * File pattern: *.jpg; | ||
* Appears if selection contains: JPEG Image Files | * Appears if selection contains: JPEG Image Files | ||
- | **Note: | + | **Note: |
+ | |||
+ | ---- | ||
- | [[https:// | + | ==== Open terminal here ==== |
- | ==== Opening a terminal ==== | + | |
- | | + | * Command |
- | * Command: '' | + | * Command 2: ''< |
* File pattern: * | * File pattern: * | ||
- | * Appears if selection contains: | + | * Appears if selection contains: |
- | **Note:** You might need to type '' | + | '' |
- | ==== Opening a root terminal ==== | + | '' |
- | * Name: **Open | + | ---- |
- | * Command: '' | + | |
+ | ==== Open root terminal | ||
+ | * Name: **Open root terminal here** | ||
+ | * Command(1): ''< | ||
+ | * Command(2): '' | ||
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Directories | * Appears if selection contains: Directories | ||
+ | |||
+ | **Note:** Use either pkexec or gksu, depending on what is available for your distro. | ||
**Note:** You should rewrite the command with normal straight quotes. | **Note:** You should rewrite the command with normal straight quotes. | ||
- | ==== Opening a root Thunar | + | ---- |
- | * Name: **Open | + | ==== Open thunar as root here ==== |
- | * Command: '' | + | * Name: **Open |
+ | * Command(1): '' | ||
+ | * Command(2): '' | ||
+ | * Command(3): '' | ||
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Directories | * Appears if selection contains: Directories | ||
- | **Note:** Some distributions no longer include '' | + | **Note:** Some distributions no longer include '' |
- | ==== Editing | + | |
+ | ---- | ||
+ | ==== Edit file as root ==== | ||
* Name: **Edit as root** | * Name: **Edit as root** | ||
- | * Command: '' | + | * Command(1): '' |
+ | * Command(2): '' | ||
* File pattern: * | * File pattern: * | ||
* 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). Also, see previous note about '' | **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 | + | ==== Create |
* Name: **Create symlink** | * Name: **Create symlink** | ||
- | * Command: '' | + | * Command: '' |
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Directories, | * 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 | + | ==== Create a hardlink |
- | * Name: **Set as desktop background** | + | * Name: **Create hardlink** |
- | * Command:< | + | * Command: |
* File pattern: * | * File pattern: * | ||
- | * Appears if selection contains: | + | * Appears if selection contains: |
- | ==== Viewing the disk usage of the current directory ==== | + | ---- |
+ | ==== View disk usage of the current directory ==== | ||
* Name: **Disk Usage** | * Name: **Disk Usage** | ||
* Command: '' | * Command: '' | ||
Line 179: | Line 221: | ||
**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 ' | + | ---- |
+ | ==== Open file in terminal | ||
* Name: **Open in Terminal** | * Name: **Open in Terminal** | ||
- | * Command: xfce4-terminal -e ' | + | * Command: xfce4-terminal -x editor |
* File pattern: * | * File pattern: * | ||
* Appearance Conditions: Text files | * Appearance Conditions: Text files | ||
+ | ---- | ||
- | Since nano isn't a GUI app, you must start it in a terminal window. | + | ==== Compare |
- | + | ||
- | ==== Comparing | + | |
* Name: **Compare** | * Name: **Compare** | ||
* Command: '' | * Command: '' | ||
Line 196: | Line 238: | ||
**Note:** You will need the '' | **Note:** You will need the '' | ||
- | ==== Changing | + | ---- |
+ | |||
+ | ==== Change | ||
**Note:** You will need '' | **Note:** You will need '' | ||
Line 210: | Line 254: | ||
You can go on, try '' | You can go on, try '' | ||
- | ==== Download subtitles | + | |
+ | ---- | ||
+ | |||
+ | ==== Download | ||
* Name: **Download subtitles** | * Name: **Download subtitles** | ||
- | * Command: '' | + | * Command: '' |
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: Video Files | * Appears if selection contains: Video Files | ||
- | **Note:** You will need '' | + | **Note:** You will need to follow the instructions on [[https://github.com/emericg/OpenSubtitlesDownload|OpenSubtitlesDownload]] which requires |
+ | |||
+ | ---- | ||
==== Rename subtitles easily ==== | ==== Rename subtitles easily ==== | ||
* Name: **Rename subtitles** | * Name: **Rename subtitles** | ||
Line 225: | Line 275: | ||
**Note:** You will need '' | **Note:** You will need '' | ||
+ | |||
+ | ---- | ||
==== Move files into a new folder ==== | ==== Move files into a new folder ==== | ||
* Name: **Move into new folder** | * Name: **Move into new folder** | ||
* Description: | * Description: | ||
- | * Command: NEW_FOLDER=$(/ | + | * Command: |
* File pattern: * | * File pattern: * | ||
* Appears if selection contains: All | * Appears if selection contains: All | ||
Line 235: | Line 287: | ||
**Note:** You'll will need the '' | **Note:** You'll will need the '' | ||
+ | ---- | ||
+ | |||
+ | ==== Create Shared Thumbnails ==== | ||
+ | * Name: **Create shared thumbnails** | ||
+ | * Description: | ||
+ | * Command: ''< | ||
+ | * File pattern: * | ||
+ | * Appears if selection contains: Folders | ||
+ | |||
+ | **Note:** Required to download [[https:// | ||
+ | ---- | ||
+ | ==== Use 'bulk rename' | ||
+ | * Name: **Open in bulk renamer** | ||
+ | * Description: | ||
+ | * Command: ''< | ||
+ | * File pattern: * | ||
+ | * Appears if selection contains: any | ||
+ | * Range: 1-1 | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ==== Trust multiple desktop files at once ==== | ||
+ | * Name: **Trust Desktop Files** | ||
+ | * Description: | ||
+ | * Command: ''< | ||
+ | * File pattern: *.desktop | ||
+ | * Appears if selection contains: other files | ||
+ | * Range: 1-1 | ||
+ | [[|Back To Top]] | ||
+ | ---- | ||
+ | [[: |