Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-04-15 20:01:01

ctac
Member
Registered: 2017-05-08
Posts: 57

[Solved] Custom action in thunar by script

I try to add custom action in thunar by script so :
I create a script for the action like this one :

#!/bin/sh
if test -d "$1" ; then
  rep="$1"
else
  rep="${1%/*}"
fi
cmd="cd '$rep' ; $SHELL -l"

if ! test -r "$rep" ; then
  cmd="echo $rep is not readable for you so you must set to root: \
    ; su -l -c '$cmd'" 
fi
xterm -title 'xterm start in '"$rep" \
      -fa 'Monospace Regular' \
      -fs 15 \
      -e "$cmd || \
         {
           tput clear
           echo Not authorized to browse $rep
           echo Sorry
           sleep 5
         }"

I want this menu item always show when i right click something in thunar so :
I add this entry in ~/.config/Thunar/accels.scm

; (gtk_accel_path "<Actions>/ThunarActions/uca-action-288-1" "")

And i modify ~/config/Thunar/uca.xml

<action>
	<icon>mini.xterm</icon>
	<name>Ouvrir xterm ici</name>
	<unique-id>288-1</unique-id>
	<command>/home/alain/bin/Open_xterm_here %f</command>
	<description>Ouvre une fenêtre xterm</description>
	<patterns>*</patterns>
	<directories/>
	<audio-files/>
	<image-files/>
	<other-files/>
	<text-files/>
	<video-files/>
</action>

But this don't work.
~/config/Thunar/uca.xml is ok
but ~/.config/Thunar/accels.scm always come back to previews and is never updated.
How can i do this ?

subsidiary question: Is it possible to set something like :

<all/>

instead off

<directories/>
...
<video-files/>

Last edited by ctac (2019-04-16 22:48:47)

Offline

#2 2019-04-16 11:54:20

ctac
Member
Registered: 2017-05-08
Posts: 57

Re: [Solved] Custom action in thunar by script

Like thunar run as a daemon you must stop it this way

thunar -q

before make change to this files.

Offline

Board footer

Powered by FluxBB