Xfce Forum

Sub domains
 

You are not logged in.

#1 2019-02-24 20:18:41

fixit
Member
Registered: 2015-01-19
Posts: 129

Thunar custom action not working

This is not working.

echo xx | sudo -S chown andy:andy -R %F

I want it change ownership of files from root to myself.

It works in a script.


Ubuntu-Mate 24.04

Offline

#2 2019-02-24 21:46:09

Jerry3904
Member
Registered: 2013-11-09
Posts: 863

Re: Thunar custom action not working

This is the one we supply with the distro, and that works. :

gnome-keyring-daemon -r -d;gksu "chown -R $USER:$USER %F"

A bit more complicated to solve the keyring annoyance and to generalize for any user.


MX-23 (based on Debian Stable) with our flagship Xfce 4.18.

Offline

#3 2019-02-25 01:34:13

fixit
Member
Registered: 2015-01-19
Posts: 129

Re: Thunar custom action not working

Thanks so much. :-)


Ubuntu-Mate 24.04

Offline

#4 2019-02-25 06:30:37

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 862

Re: Thunar custom action not working

are you expecting the echoed value to be used?

Offline

#5 2019-02-25 22:39:21

fixit
Member
Registered: 2015-01-19
Posts: 129

Re: Thunar custom action not working

Skaperen wrote:

are you expecting the echoed value to be used?

It's not my real password.

But the echo has worked with other custom actions.


Ubuntu-Mate 24.04

Offline

#6 2019-02-25 23:25:53

Skaperen
Member
From: right by Jesus, our Saviour
Registered: 2013-06-15
Posts: 862

Re: Thunar custom action not working

you should not have to repeatedly enter your password.  properly configured, it should cache your authentication so that you enter your password just once and subsequent runs of sudo should not want your password.

Offline

#7 2019-02-25 23:55:17

ToZ
Administrator
From: Canada
Registered: 2011-06-02
Posts: 11,485

Re: Thunar custom action not working

fixit wrote:

But the echo has worked with other custom actions.

Try embedding it inside a bash block:

bash -c "echo 'xx' | sudo -S chown andy:andy -R %F"

...this creates a bash environment to run the command in. The default environment when running custom actions is not your regular bash environment.


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

#8 2019-03-01 20:05:44

fixit
Member
Registered: 2015-01-19
Posts: 129

Re: Thunar custom action not working

Jerry3904 gnome-keyring-daemon -r -d;gksu "chown -R $USER:$USER %F" worked great.

I forgot how to make a code section.

Last edited by fixit (2019-03-01 20:06:57)


Ubuntu-Mate 24.04

Offline

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

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.016 seconds, 12 queries executed - Memory usage: 537.35 KiB (Peak: 538.2 KiB) ]