Xfce Forum

Sub domains
 

You are not logged in.

#1 2020-06-21 20:59:36

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

Custom action to change owner from root to me

I am trying to create a custom action to change owner of files from root to me.

This is not working.

echo 777 | sudo -S "chown -R andy:andy %f"

Offline

#2 2020-06-21 23:05:42

Misko_2083
Member
Registered: 2015-10-13
Posts: 142
Website

Re: Custom action to change owner from root to me

That's a bit scary custom action.
At least add a password dialog.

yad --form --field="":H --text="Sure you want?"  | sudo -k -S chown -R andy:andy %f || yad --text="Fail"

Offline

#3 2020-06-22 01:19:13

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

Re: Custom action to change owner from root to me

Misko_2083 wrote:

That's a bit scary custom action.
At least add a password dialog.

yad --form --field="":H --text="Sure you want?"  | sudo -k -S chown -R andy:andy %f || yad --text="Fail"

First I typed yes and it failed.

Then my password and it failed?

This works until we can fix the "yad" statement. :-)

echo pass | sudo -k -S chown -R andy:andy %f

Last edited by fixit (2020-06-22 01:25:08)

Offline

#4 2020-06-22 09:28:36

Misko_2083
Member
Registered: 2015-10-13
Posts: 142
Website

Re: Custom action to change owner from root to me

Sorry, I forgot about the separator.

yad --form --field="":H --text="Sure you want?"  --separator="\n"

Offline

#5 2020-06-22 15:58:36

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

Re: Custom action to change owner from root to me

No problem. Thanks for your help.

I am impressed with all that yad can do.

 yad --form --field="":H --text="Enter password." --separator="\n" | sudo -k -S chown -R andy:andy %f || yad --text="Fail" --timeout=3

Last edited by fixit (2020-06-22 16:01:22)

Offline

Board footer

Powered by FluxBB