This forum has been archived. All content is frozen. Please use KDE Discuss instead.

[Solved] Copy a file in a file system folder under Wayland ?

Tags: None
(comma "," separated)
alan
Registered Member
Posts
22
Karma
0
Hi,

I would like to know how to copy a file in a file system folder under Wayland with the help of Dolphin.

For example: I would like to copy a picture.jpg file in the /usr/share/wallpapers folder in a wayland session with the help of Dolphin.

I don't want to use the command line.

Thanks.

Last edited by alan on Tue Oct 27, 2020 11:52 am, edited 1 time in total.
User avatar
abury
Registered Member
Posts
190
Karma
1
OS
IF you're wanting to copy TO a root folder, you're obliged to do so as ROOT!
otherwise a copy from a root folder to a local one... is just simply that, a copy process
(true at least for my current version of plasma)
so assuming that this is a root copy, one way is to create a ServiceMenu...
Code: Select all
kwrite ~/.local/share/kservices5/ServiceMenus/openasroot.desktop
if you don't use "kwrite" then replace it with whatever editor you're using
and paste the following
Code: Select all
[Desktop Entry]
Type=Service
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
X-KDE-Priority=TopLevel
MimeType=inode/directory;
Actions=OpenDolphinRoot;
//
[Desktop Action OpenDolphinRoot]
Name=Open as Root!
Icon=folder-red-drag-accept
Exec=pkexec env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY KDE_SESSION_VERSION=5 KDE_FULL_SESSION=true dolphin %u

NB caution: you now have a root based action within Dolphin to do what you're asking to do!


KDE neon 5.20 - Plasma 5.20.5 - Frameworks 5.78 - Qt 5.15.2 - Kernel 5.4.0-65
alan
Registered Member
Posts
22
Karma
0
@abury: Thanks for your reply. ;)

I have tried this kind of solution before. It works perfectly under xorg/X11, but under Wayland nothing happens (Even if I indicate the admin password). Wayland is very restrictive with root permissions and graphical root access. Perhaps something is missing to make it works under wayland ?

Regards.
User avatar
abury
Registered Member
Posts
190
Karma
1
OS
Mmmm... you're right!
specifically, Dolphin in Wayland indicates that I have "No protocol specified"
so, gonna have to figure that one out!
but I also get the following:
qt.qpa.xcb: could not connect to display :1
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized.
Reinstalling the application may fix this problem.

and reinstalling did not solve it
seems that it's a QT issue...


KDE neon 5.20 - Plasma 5.20.5 - Frameworks 5.78 - Qt 5.15.2 - Kernel 5.4.0-65
User avatar
abury
Registered Member
Posts
190
Karma
1
OS
It appears to more complicate that expected...
in Wayland--at least with Dolphin--copying from a root folder works but copying into does not
however using command line sudo cp does work as expected
so, this seems to indicate that there's some xserver-X11-display-related issue (?)
I guess this is why Wayland is not the default session...
but at least now we know another method, apart from Dolphin!


KDE neon 5.20 - Plasma 5.20.5 - Frameworks 5.78 - Qt 5.15.2 - Kernel 5.4.0-65
alan
Registered Member
Posts
22
Karma
0
@abury: I found a solution to my problem. I can use dolphin as root by using these lines : xhost +si:localuser:root and xhost -si:localuser:root with your Exec=pkexec ..... command line. I know this is not a perfect or 'good' solution but it is the only one I found and It works.

I will close the subject.

Thanks for your help.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]