Using thunar as my file manager. Sometimes I want to paste things in the directories that I don't own.
Now, I know that I can use the terminal to make a new window with elevated privilages with sudo thunar
. But seems too long a step. So I want to make a custom action which can be used with the context menu.
Trying the command with terminal first to try it out.
Now as an example I will try to copy the opera.desktop file from my ~/Desktop
to /opt/
Since gksudo is deprecated, I decided to use the new pkexec
Attempt 1: Use pkexec with the cp command
tim@timmy-Inspiron-3505:~/Desktop$ pkexec cp opera.desktop /opt/
/usr/bin/cp: cannot stat 'opera.desktop': No such file or directory
Attempt 2: Elevate privilege before copying
tim@timmy-Inspiron-3505:~/Desktop$ pkexec su && cp opera.desktop /opt/ && exit
root@timmy-Inspiron-3505:~#
I don't know what else to try. Any suggestions ?