[Thunar-dev] Custom actions

Dani dani at damufo.com
Wed Mar 6 17:05:31 CET 2019


Hello André:

Thanks for reply.

When run thunar from terminal, no show nothing.
(Seems to have no verbose mode, as -> $ thunar &)

I have no way of knowing what is going to fail.


This not work for me:

for i in %F; do source=$i; moveTo="/blog_src/"; 
target="${source/\/blog_web\//$moveTo}"; mv "$source $target"; done

If execute in terminal (xfce4-terminal) work fine.


I test with (multi select)

for i in %F; do source=$i; moveTo="/blog_src/"; 
target="${source/\/blog_web\//$moveTo}"; zenity --info --text=$source; 
zenity --info --text=$moveTo; zenity --info --text=$target; done

No show anything

But with this:
for i in %F; do source=$i; zenity --info --text=$source; 
moveTo="/blog_src/"; zenity --info --text=$moveTo; 
target="${source/\/blog_web\//$moveTo}";  zenity --info --text=$target; done

Only show 2 first messages (zenity). That's why I think that when it 
arrives to the part of the replacement 
(target="${source/\/blog_web\//$moveTo}";) it is when it fails.

Very thanks.

Dani

O 06/03/19 ás 16:16, André Miranda escribiu:
> Hi Dani,
> From what I could understand, you want to move files from blog_web to 
> blog_src.
> For me the snippet you provided works as expected, I just had to use 
> quotes on mv "$source" "target" so whitespace is correctly handled.
>
> By the way, I'm using zsh as the system default shell, but I think 
> that substitution works on bash too.
>
> It may be helpful to launch Thunar from terminal (thunar -q && thunar) 
> and watch out for error messages.
>
> HTH,
> Andre Miranda
>
> On 06/03/2019 08:31, Dani wrote:
>> Hello:
>>
>> I'm trying to do a personalized action. In this case I try to move a 
>> file from one folder to another.
>> This command works well in the terminal more when I put it as a 
>> custom order it will not
>> If I'm not mistaken, the error is in the replacement.
>>
>>
>> for i in %F; do source=$i; moveTo="/blog_src/"; 
>> target="${source/\/blog_web\//$moveTo}"; mv $source $target; done
>>
>>
>> This work fine on terminal:
>> for i in "/home/dani/blog/blog.org/blog_web/tprd/1819/file1.odt" 
>> "/home/dani/blog/blog.org/blog_web/tprd/1819/file2.odt"; do 
>> source=$i; moveTo="/blog_src/"; 
>> target="${source/\/blog_web\//$moveTo}"; mv $source $target; done;
>>
>>
>> Is this an error or am I doing something wrong?
>>
>>
>> Very thanks!
>>
>
> _______________________________________________
> Thunar-dev mailing list
> Thunar-dev at xfce.org
> https://mail.xfce.org/mailman/listinfo/thunar-dev





More information about the Thunar-dev mailing list