You are not logged in.
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
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
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
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
[ Generated in 0.014 seconds, 7 queries executed - Memory usage: 537.09 KiB (Peak: 537.94 KiB) ]