Xfce Forum

Sub domains
 

You are not logged in.

#1 2024-10-20 09:22:37

hillwalker
Member
Registered: 2024-10-20
Posts: 4
LinuxChrome 128.0

[Solved] Thunar 4.18.11 don't execute custom actions

Hello,
I tried to define a custom action (Linux - 6.11.3-arch1-1; Xfce4-Version: 4.18; Thunar: 4.18.11)
Here the definitions in 'uca.xml'

<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
  <icon>utilities-terminal</icon>
  <name>Terminal hier öffnen</name>
  <submenu></submenu>
  <unique-id>1699900010481279-1</unique-id>
  <command>exo-open --working-directory %f --launch TerminalEmulator</command>
  <description>Beispiel für eine eigene Aktion</description>
  <range></range>
  <patterns>*</patterns>
  <startup-notify/>
  <directories/>
</action>
<action>
  <icon>emblem-default</icon>
  <name>Python-Datei ausführen</name>
  <submenu></submenu>
  <unique-id>1729407380302893-1</unique-id>
  <command>exo-open --working-directory %d --launch TerminalEmulator python3 %f</command>
  <description>Datei im Terminal öffnen</description>
  <range>*</range>
  <patterns>*.py</patterns>
  <text-files/>
</action>
</actions>

Even the predfined first action from the developers won't work. i tried several other actions from here:
https://docs.xfce.org/xfce/thunar/custom-actions
The defined actions are shown in the context menu but not executed.
To test the principal working I tried direct in the Terminal

exo-open --working-directory /mnt/common --launch TerminalEmulator python3 pyAsyncExample.py

The code will be executed, but the opened terminal will be closed directly (normal behaviour). So my additional question, how can I include the '-H' option of the xfce-terminal in this special command line (also in action command line)

Thanks in advance

PS. As a new member I want to say 'Hello' to all users!

Last edited by hillwalker (2024-10-24 19:08:26)

Offline

#2 2024-10-20 09:48:50

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,481
LinuxFirefox 131.0

Re: [Solved] Thunar 4.18.11 don't execute custom actions

Hello and welcome.

Instead of using exo-open, why not just execute:

xfce4-terminal --working-directory %d -H -x python3 %f

I don't think exo-open supports passing parameters because it is simply a launch mechanism and can't guarantee all parameters will work for all terminal emulators.

Even the predfined first action from the developers won't work. i tried several other actions from here:
https://docs.xfce.org/xfce/thunar/custom-actions
The defined actions are shown in the context menu but not executed.

Specifically which ones don't work?


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 2024-10-20 14:11:01

hillwalker
Member
Registered: 2024-10-20
Posts: 4
LinuxChrome 128.0

Re: [Solved] Thunar 4.18.11 don't execute custom actions

Hello and thanks,
your suggestion for the 'python'-action works. Now to the predefined action in thunar

exo-open --working-directory %f --launch TerminalEmulator

I must correct my first thread. The terminal opens but not with the selected directory. Some explanation:
The last line in my 'bashrc' is

cd /mnt/common

because this is my working dir. The terminal and thunar opens always with this 'dir'.
When I remove the last line from the 'bashrc' the custom action works as expected. Deep in my brain with connecting all synapsen I can explain 'why' but not exactly. Your question what I have tried from here https://docs.xfce.org/xfce/thunar/custom-actions, I can't remember all, but 'Open a Root Terminal from here' was surely one (no further explanation necessary for this).

Thanks in advance

Offline

#4 2024-10-21 00:39:44

BenyaminL
Member
Registered: 2019-10-11
Posts: 70
Website
LinuxFirefox 131.0

Re: [Solved] Thunar 4.18.11 don't execute custom actions

hillwalker wrote:

The last line in my 'bashrc' is

cd /mnt/common

because this is my working dir. The terminal and thunar opens always with this 'dir'.
When I remove the last line from the 'bashrc' the custom action works as expected.

That code is intefering with the xfce terminal working directory. You either need to check if the working directory supplied or not using args checker or directly use a shell script and get the %d on the shell script parameters.

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.014 seconds, 7 queries executed - Memory usage: 537.09 KiB (Peak: 537.94 KiB) ]