Xfce Forum

Sub domains
 

You are not logged in.

#1 2018-10-30 14:37:15

Mendelsohn
Member
Registered: 2018-10-30
Posts: 5

Group Custom Actions in Thunar

Hi,

at the moment i'm using dolphin as my default file manager on xfce. but all that kde stuff makes a lot of trouble and i want to change to thunar completely. first i've converted all my service menus to thunars custom actions. but how can i group custom actions into one point when i click the right key? in dolphin there is a menu entry (for example "audio") and when i move the mouse over that menu entry it pops up the "real" custom actions that can convert an audio file into an other audio file or do something different.

is this possible with thunar?

mendelsohn

Offline

#2 2018-10-30 16:48:24

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Group Custom Actions in Thunar

Hello and welcome.

This isn't currently possible with thunar. See this bug report.

As a potential workaround or option, have a look at a script written by one of our members (Misko_2083) that provides this functionality.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#3 2018-10-30 19:55:54

Mendelsohn
Member
Registered: 2018-10-30
Posts: 5

Re: Group Custom Actions in Thunar

thanks, but how can i use that script? there isn't a howto in the thread or on gitlab. the readme provides no information about that.

this plugin doesn't work? https://goodies.xfce.org/projects/thuna … ons-plugin

Offline

#4 2018-10-30 20:05:55

pgen
Member
Registered: 2018-04-10
Posts: 2

Re: Group Custom Actions in Thunar

Hi,

another solution I use is a bash script for each group with a "zenity --list" menu and each action as a "case ... in ..." entry in the menu ...

pgen

Offline

#5 2018-10-30 20:37:05

Mendelsohn
Member
Registered: 2018-10-30
Posts: 5

Re: Group Custom Actions in Thunar

can you give an example? how does it work? i think its a extra window that pop up when you click on a custom action?

Offline

#6 2018-10-30 22:07:27

pgen
Member
Registered: 2018-04-10
Posts: 2

Re: Group Custom Actions in Thunar

A part of my .pdf thunar actions script as example (Sorry, in french ...)... :

Script file : thunar_actions_pdf.sh

#!/bin/bash
# nom: thunar_actions_pdf.sh
menu=$(zenity --width=500 --height=400 --title "Thunar Actions PDF" --text="<b>Activités :</b>"\
  --list --hide-column 1 --column="N°" --column="Intitulé" --column="Description"\
    01  "   Réduire pdf " "Réduit le poids du fichier"\
    03  "   Concaténer les fichiers " "Assemble plusieurs fichiers .pdf en 1 seul"\
    05  "   Rotation " "Rotation de toutes les pages du fichier sélectionné"\
    07  "   Extraction " "Extraction de pages du fichier sélectionné"\
...
    12  "   convert .png" "+ density 450"\
    13  "   OCR" "pdf2png2txt"\
    14  "   OCR" "img2txt"\
    99 "Editer le script" " "\
)
case $menu in
01) ### REDUIRE POIDS
for arg in "$@"; do
orig=$(echo "$arg" | sed 's/\.\w*$/_original.pdf/')
mv "$arg" "$orig"
gs -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -dPDFSETTINGS=/ebook  -sOUTPUTFILE="$arg" -f "$orig"
done
notify-send -i /usr/share/icons/elementary-xfce/status/32/dialog-information.svg \
"Fichiers "$arg" réduits" "Sauvegarde des originaux sous "$dest""
exit
;;
    ...
esac

You can add as many case entry as you want and in each case entry, you also may use another zenity box (to add parameters : page number, output quality or name,... ) or send input file(-s) to external scripts or appli.

In Thunar custom actions config :
Name : "Actions PDF"
Command : "/path-to/thunar_actions_pdf.sh %F"
File patterns :"*.pdf"

When you choose "Actions PDF" on right-click, a zenity box pop up with all actions you put in the script ... No more tricky ! ;-)

pgen

Offline

#7 2018-10-31 11:50:32

Mendelsohn
Member
Registered: 2018-10-30
Posts: 5

Re: Group Custom Actions in Thunar

ok, this works, even its not exactly what i'm searching for.

@ ToZ

can you please tell me how to use the linked script?

Offline

#8 2018-11-01 00:54:02

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Group Custom Actions in Thunar

Mendelsohn wrote:

@ ToZ

can you please tell me how to use the linked script?

The author of the script is a member here and perhaps he will drop by. But to get the script to work, follow the instructions at the top of the file. Posted here for convenience:

#  Save this file to /usr/local/bin/zoose.py
#  Setting thunar custom action:
#  Name: Audio options
#  Description : Manipulate Audio Files
#  Command: python3 /usr/local/bin/zoose.py "%F"

#  File Pattern: *
#  Appearance: Directories, Audio files

Once the custom action is created, you can click on a directory or audio file, and you should get a popup with options (those in the zoose_icons [] array that you have installed on your computer).

You can edit the zoose_icons [] array and add those applications that you have installed on your computer.

You can also create copies of the zoose.py file specific for other functions like "Graphic Options", "Document Options", etc., and adjust the zoose_icons [] array to specify the options and create separate custom actions entries or each.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

#9 2018-11-01 10:03:30

Mendelsohn
Member
Registered: 2018-10-30
Posts: 5

Re: Group Custom Actions in Thunar

OK, there was something wrong. i downloaded the *.py by right click on the file name a 'save'. the downloaded file was completely different, not python. now after copy the file manually it works.

but its not a real pop up menu like dolphin has? here i have to move the mouse over the menu entry and the sub menu pop up. i don't have to click.

Offline

#10 2018-11-01 10:44:49

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 10,948

Re: Group Custom Actions in Thunar

Yes. These are just options and workarounds. The functionality you are looking for doesn't currently exist (the Thunar Actions Plugin is out of date and doesn't work with the current versions of thunar or Xfce build components). The bug report I referenced in post #2 above is about adding back this functionality.


Please remember to mark your thread [SOLVED] to make it easier for others to find
--- How To Ask For Help | FAQ | Developer Wiki  |  Community | Contribute ---

Offline

Board footer

Powered by FluxBB