Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
xfce:thunar:custom-actions [2022/12/11 21:42] – [Download video subtitles] alexxconsxfce:thunar:custom-actions [2025/06/16 11:26] (current) – [Create Shared Thumbnails] alexxcons
Line 1: Line 1:
 ~~NOTOC~~ ~~NOTOC~~
-{{ :xfce:xfce.thunar.png?no link|}}+{{ :xfce:thunar.png?nolink|}}
 ====== Thunar - Custom Actions ====== ====== Thunar - Custom Actions ======
  
Line 30: Line 30:
     * **[[#Create Shared Thumbnails|Create Shared Thumbnails]]**     * **[[#Create Shared Thumbnails|Create Shared Thumbnails]]**
     * **[[#Use 'bulk rename' on a single file|Use 'bulk rename' on a single file]]**     * **[[#Use 'bulk rename' on a single file|Use 'bulk rename' on a single file]]**
 +    * **[[#Trust multiple desktop files at once|Trust multiple desktop files at once]]**
   * **[[https://help.ubuntu.com/community/ThunarCustomActions|List of assorted custom actions]]** (from Ubuntu documentation)   * **[[https://help.ubuntu.com/community/ThunarCustomActions|List of assorted custom actions]]** (from Ubuntu documentation)
  
Line 38: Line 39:
 This section provides a step-by-step introduction to the **Custom Actions** plugin, demonstrating how to add a simple action. 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 ''+''). The **Create Action** dialog will appear, as shown in the screenshot below. This section provides a step-by-step introduction to the **Custom Actions** plugin, demonstrating how to add a simple action. 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 ''+''). The **Create Action** dialog will appear, as shown in the screenshot below.
  
-<figure "Create Action Dialog"> +<figure "Create Custom Action Dialog"> 
-{{:xfce:thunar:uca-create.png|}}+{{:xfce:thunar:uca-create.png|Create Custom Action Dialog Window}}
 </figure> </figure>
  
Line 68: Line 69:
 Now close the **Custom Actions** dialog, select a folder in Thunar and open the context menu (right-click on the file icon). The newly created **Search with Catfish** action will appear in the context menu, as shown in the screenshot below. Now close the **Custom Actions** dialog, select a folder in Thunar and open the context menu (right-click on the file icon). The newly created **Search with Catfish** action will appear in the context menu, as shown in the screenshot below.
  
-<figure "Custom Actions Dialog"> +<figure "Custom Actions List Dialog"> 
-{{:xfce:thunar:uca-list.png}}+{{:xfce:thunar:uca-list.png|Custom Actions List Dialog}}
 </figure> </figure>
  
Line 142: Line 143:
 ==== Rotate JPEGs ==== ==== Rotate JPEGs ====
     * Name: **Rotate Clockwise**     * Name: **Rotate Clockwise**
-    * Command: ''<nowiki>for file in %F; do tempfile=$(mktemp) && jpegtran -copy all -rotate 90 "$file""$tempfile" && mv -f "$tempfile" "$file"rm -"$tempfile"; done</nowiki>''+    *  
 +    * Command: ''<nowiki>for file in %F; do exiftran -i9 "$file"; done</nowiki>'' 
 +    * Command(counterclockwise): ''<nowiki>for file in %Fdo exiftran -i2 "$file"; done</nowiki>''
     * File pattern: *.jpg;*.JPG;*.jpeg;*.JPEG     * File pattern: *.jpg;*.JPG;*.jpeg;*.JPEG
     * 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 "convert", the complicated loop structure is necessary with "jpegtran": "jpegtran -rotate 90 -outfile %F %F" will produce a 0kb file. +**Note:** exiftran is available for most distributions.
- +
-[[https://thelinuxchronicles.blogspot.com/2012/06/thunar-custom-actions-resize-and-rotate.html|Here an example]] how rotation can be scripted with "convert".+
  
 ---- ----
Line 166: Line 167:
 ==== Open root terminal here ==== ==== Open root terminal here ====
     * Name: **Open root terminal here**     * Name: **Open root terminal here**
-    * Command: ''<nowiki>gksu xfce4-terminal --default-working-directory=%f</nowiki>''+    * Command(1): ''<nowiki>pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY dbus-launch xfce4-terminal --default-working-directory=%f</nowiki>'' 
 +    * Command(2): ''<nowiki>gksu xfce4-terminal --default-working-directory=%f</nowiki>''
     * 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.
Line 175: Line 179:
 ==== Open thunar as root here ==== ==== Open thunar as root here ====
     * Name: **Open thunar as root here**     * Name: **Open thunar as root here**
-    * Command: ''gksu thunar %f''+    * Command(1): ''pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY dbus-launch thunar %f'' 
 +    * Command(2): ''thunar admin:/''''/''''/%f'' 
 +    * Command(3): ''gksu thunar %f''
     * File pattern: *     * File pattern: *
     * Appears if selection contains: Directories     * Appears if selection contains: Directories
  
-**Note:** Some distributions no longer include ''gksu''. Use ''pkexec'' instead.+**Note:** Some distributions no longer include ''gksu''. Use ''pkexec'' or the ''admin'' interface instead.
  
 ---- ----
 ==== Edit file as root ==== ==== Edit file as root ====
     * Name: **Edit as root**     * Name: **Edit as root**
-    * Command: ''gksu put-your-favourite-text-editor-here %f''+    * Command(1): ''pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY dbus-launch put-your-favourite-text-editor-here %f'' 
 +    * Command(2): ''gksu put-your-favourite-text-editor-here %f''
     * File pattern: *     * File pattern: *
     * Appears if selection contains: Text files     * Appears if selection contains: Text files
Line 220: Line 227:
     *  File pattern: *     *  File pattern: *
     * Appearance Conditions: Text files     * Appearance Conditions: Text files
 +
 ---- ----
  
Line 288: Line 296:
     * Appears if selection contains: Folders     * Appears if selection contains: Folders
  
-**Note:** Required to download [[https://raw.githubusercontent.com/SKefalidis/DBusSharedThumbnailRepositoryCreator/main/sharedx.sh|this script]] and store it locally. Requires ''python3'' and ''realpath''.+**Note:** Required to download a thumbnail generation script. Candidates are:  
 + 
 +    * {{ :xfce:thunar:sharedx.sh.tar.gz |Generic script to request thumbnails via DBus API}} ([[https://raw.githubusercontent.com/SKefalidis/DBusSharedThumbnailRepositoryCreator/main/sharedx.sh|source]]). Requires ''python3'' and ''realpath''. 
 + 
 + 
 +<note important>Attention: Read and use external thumbnail generation scripts with caution! They are not part of Xfce and are not tested / reviewed.</note>
 ---- ----
 ==== Use 'bulk rename' on a single file ==== ==== Use 'bulk rename' on a single file ====
Line 296: Line 309:
     * File pattern: *     * File pattern: *
     * Appears if selection contains: any     * Appears if selection contains: any
 +    * Range: 1-1
 +
 +----
 +
 +==== Trust multiple desktop files at once ====
 +    * Name: **Trust Desktop Files**
 +    * Description: Sets gvfs checksum and +x flag for all selected *.desktop files
 +    * Command: ''<nowiki>for f in %F; do sha256sum "$f" | awk '{print $1}' | xargs gio set "$f" metadata::xfce-exe-checksum && chmod +x "$f"; done</nowiki>''
 +    * File pattern: *.desktop
 +    * Appears if selection contains: other files
     * Range: 1-1     * Range: 1-1
  
 [[|Back To Top]] [[|Back To Top]]
 ---- ----
-[[:xfce:thunar:|Back to Thunar documentation page]]+[[:xfce:thunar:|Return to Thunar Main Documentation Page]]