The "Right Way" To Modify System Files and Folders in KDE Since Dolphin Cannot Be Opened As Root

I have had a number of discussions with people about opening Dolphin as root. Some say its a blunder by the devs for eliminating this capability, some say its for security, some say something different but this is not the point of this post. I had posted a thread here how to open Dolphin with elevated privileges but it was removed by the forum moderators stating that I was causing others possible harm and further informed me that I am doing it all wrong and there is no reason to open a File Manger with elevated privs. Since others that are smarter then I have informed me that I am doing things incorrectly i am posting this thread to find out the right way to do the following task.

Other then doing it via the terminal (in which case I might just eliminate a GUI all together and I already know the mv or cp command and the absolute path) or using a different file manager, I donā€™t know how to do the following.

My question is this. I want to copy a folder titled ā€œthemesā€ from my backup drive to my file system under /usr/share/emerald but I need elevated privs to copy to that directory. So since i cannot open KDEā€™s default file manager as root, how would I copy this folder to this location ā€œthe right wayā€?

3 Likes

hi
maybe you can use other file managers such as thunar, pcmanfm etcā€¦just install it on your system first.

Any tool you would like, with the correct privileges.
For elevated privileges we usually use sudo in the terminal, and a common terminal copy tool is cp.
ex:

sudo cp /path/to/item /path/it/should/go/to

But since you want to copy the directory you are going to want to use -r for recursive:

sudo cp -r /path/to/item /path/it/should/go/to

Other copy tools might include rsync

If you need a GUI or something embedded in dolphinā€¦

There is a package kde-servicemenus-rootactions which will give you cp/mv options ā€˜as rootā€™ ā€¦ or rather polkit. Though it should be updated/fixed/improved.

Other possibilities include creating something like this:

#!/usr/bin/env bash
#
# sudocp
#
# <3 cscs <3
#
GETZ=$(zenity --file-selection --multiple --window-icon=/usr/share/icons/Adwaita/scalable/actions --separator=' ' --confirm-overwrite --title="Select Files")
PUTZ=$(zenity --file-selection --directory --window-icon=/usr/share/icons/Adwaita/scalable/actions --confirm-overwrite --title="Select Destination")
printf "$GETZ" > /tmp/sudocplist.txt;
for PIXZ in $(cat /tmp/sudocplist.txt); do pkexec cp "$PIXZ" "$PUTZ"; done
exit

As an example of ā€˜copy filesā€™ with a gui file-picker and either use it as standalone application/script or integrate it into the dolphin service menus (right click option).

2 Likes

There really isnā€™t. One wrong clickety-clickā€¦:boom: And then the inevitable:

$distro/$de/$filemanager sucks, because it broke my system. 

:man_shrugging:

Why do you feel that way? Iā€™ve never used KDEā€¦but isnā€™t there a shortcut to open a terminal? I mean, isnā€™t it a bit dramatic to ā€œeliminate a GUIā€ for:

  • Shortcut key - open terminal
  • type a 1 line command
  • close terminal
2 Likes

I know how you feelā€¦ I have been a Windows user for about 10 years and just recently switched completely to Linux.
So using a GUI to Copy Paste things is how I am used to doing things, and I am sure many other noobs feel the same way. Although, I also understand that the command line has been the linux way of doing these things for years.
I usually install a different file manager that has the ability to have root privileges in GUI and get the job done.

But about that claim regarding the command line, I donā€™t understand how itā€™s more secure than GUI with root, if the user knows what they are doing in both cases.

2 Likes

Then you are just recreating the same problem.

Because of permissions, mistakes, and if you sudo GUI-APP you give root privileges to all of X.
sudo was never meant for graphical applications. It certainly is not properly compatible with X and never will be. There are probably even more concerns ā€¦ but to do what you are talking about is so utterly broken no one has ever taken a full appraisal of all of its consequences.

Thats why KDE/Dolphin doesnt allow you to do it.
If you must then use polkit. And ā€¦ surprise ā€¦ the plasma devs are almost done implementing it properly.
So for anyone who refuses to learn the command line, and for some reason spends hours moving/copying system files, and requires a GUI file manager, (and somehow finds that faster for that giant workload) ā€¦ then they can also just wait and one day it will be there from a dolphin update.

4 Likes

Thanks for that informative reply. I learned something.
I didnā€™t know it was such a security issue, so I was just casually installing a different file manager which allowed for rooted GUI.

If this is about this, youā€™re doing it wrong. These packages are available in AUR. Just Install the ones you want.

[mochobb@mocho-desktop ~]$ trizen -Ss emerald
aur/emerald 0.8.18-1 [37+] [0.00%] [28 Apr 2020]
    Emerald window decorator
aur/emerald-equinox-themes 20100324-1 [unmaintained] [2+] [0.00%] [29 Jul 2015]
    Equinox emerald themes
aur/emerald-git 0.8.14.r18.g93e490c-1 [7+] [0.00%] [5 Jun 2018]
    Emerald window decorator
aur/emerald-gtk3 0.8.18-2 [3+] [0.12%] [6 Nov 2020]
    Emerald window decorator
aur/emerald-gtk3-git 0.8.14.r18.g93e490c-1 [1+] [0.00%] [5 Jun 2018]
    Emerald window decorator
aur/emerald-icon-theme 20180202-1 [unmaintained] [0+] [0.00%] [2 Feb 2018]
    Fresh and simple personality icon theme
aur/emerald-icon-theme-git 2018.02.02.r18.ge2d3520-2 [0+] [0.00%] [18 Dec 2019]
    Fresh and simple personality icon theme
aur/emerald-theme-qaz-blue-vista 1.0-1 [0+] [0.00%] [2 Jul 2019]
    A blue vista theme for emerald.
aur/emerald-themes 0.8.18-1 [51+] [0.12%] [28 Apr 2020]
    Themes for emerald
aur/emerald-themes-git 0.8.14.r4.gb81f5f9-1 [3+] [0.00%] [5 Jun 2018]
    Themes for emerald
aur/emerald-wallet-bin 1.0.0-1 [out-of-date] [1+] [0.00%] [15 Jul 2018]
    Ethereum Classic Wallet
aur/qaz-blue-vista 1.0-1 [out-of-date] [unmaintained] [0+] [0.00%] [2 Jul 2019]
    A blue vista theme for emerald.
aur/xemeraldia 0.4.3-4 [0+] [0.00%] [19 May 2016]
    A Tetris-like falling blocks game

EDIT: user theme customization usually goes under ~/.local/. No need to mess with /usr/ manually.

1 Like

The more I participate in this forum, the more I donā€™t like it. Did you seriously just suggest to not modify my own system files and only use the ones available in the repository and that Iā€™m doing it wrong because I want to use my own files and not files you guys make available?

I have a troth of stored emerald themes Iā€™ve collected over the decades but there are a few nice themes in there. Thank you for the suggestion.

1 Like

Again, the best way would be to create a link in /usr/share/emerald/ to a folder in your home diretory. Better yet, you should ask the devs to take precedence from a folder in your home (in ex.: ~/.local/share/emerald) relatively to the system folder in /usr/, because thatā€™s the proper way to do it.

As you already know what you want and how you want to achieve it, Iā€™m closing this topic. Many answers were given to you. We try to give answers which keep the system organize and minimize accidental damage, but of course youā€™re free to do whatever you want. If you want to use a GUI FM as root then do it. You have plenty of options for this.

3 Likes

Yes. Because Packages are the preferred way. Its easier. Its updated. The system recognize the files so exchanges work (no ā€˜/some/file exists on system - failed to upgradeā€™), etc.
Stop trying to pretend like better practices are infringing on your freedoms.
Do whatever you want ā€¦ but conventions do exist, whether you want to recognize them or not.

3 Likes