Registered Member
|
That package doesn't exist in kubuntu - just "kde-cli-tools" - that is installed, but no kdesu available.
|
Registered Member
|
According to http://packages.ubuntu.com/vivid/amd64/ ... s/filelist it is available as /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu. So either run:
Or create a symlink in /usr/bin/ (or similar):
Then you should be able to run "kdesu kwrite"... (no idea if it will work though) (if you are on a 32bit system, you'd have to replace /usr/lib/x86_64-linux-gnu/libexec/kf5/kdesu with /usr/lib/i386-linux-gnu/libexec/kf5/kdesu) |
Registered Member
|
I've been having this same issue. However, I have found out that it is not limited to Kate. In fact, it affects all apps ported to Frameworks 5. This includes Gwenview and Konsole. Strangly enough, all apps running on Plasma 4 (such as Dolphin) retain their theme when run using sudo. I think it has something to do with QT 5 vs 4, but I'm not entirely sure.
For the record, I am running Manjaro KDE 0.9.0-pre3. |
Registered Member
|
Thank you to the people in this thread I finally solved the Breeze styling issue for root programs, like KDE Partition Manager, and Kate.
When I'd run KDE Partition Manager, the style would be so bare, it wouldn't even display icons, which is a problem because when going to View -> File System Support, the table would appear empty, which is a bug. And since this program needs to run as root, the issue is unavoidable. So let me share how I solved this and ask how to report this as a bug. First, I'm running Kubuntu 16.04, Plasma 5.6.5, Frameworks 5.23.0, Qt 5.5.1, Kernel 4.4.0-34, using Breeze Dark as the system theme. I have to launch Konsole and type:
In contrast, KDE4 programs display properly themed with this pattern:
If -E is passed to sudo for a KDE4 program, then it won't run at all. The output is this:
I want to report this as a bug, but which category does this fall under? Plasma shell? Kickoff? Qt? |
Registered Member
|
As I already wrote, don't use sudo for running graphical applications, that's dangerous and may even break your user account (the applications could change the ownership of files in your user's home directory to root).
And depending on the sudo setup on your system/in your distribution, it won't work anyway. Use kdesu or xdg-su instead. In the case of partitionmanager that's not even necessary though. It should switch to root by itself if you run it as user. |
Registered Member
|
You can add the following line to /etc/environment
XDG_CURRENT_DESKTOP="KDE" |
Registered Member
|
Thank you for your response. I tested everything you mentioned, and this is what I found...
Kubuntu doesn't have kdesu, but it does have kdesudo, but that still results in the same non-theming issue as I began with (essentially no change). Kubuntu doesn't have xdg-su either, even though I have the xdg-utils package installed.
If I run partitionmanager from the terminal, it asks for a password via kdesudo. Same happens when running it from the system menu. And again, partitionmanager is unthemed, so I can't see the light icons against an unthemed white background.
I checked and both bash and fish shells have this already declared. So I'm back where I started and even though I hear what you're saying about the danger of running it as "sudo -E partitionmanager", that's the only way that works for me so far. Would this be a distro bug then to report to Kubuntu? |
Registered Member
|
As I wrote in my last reply before you joined in, Kubuntu does have kdesu, it is part of kde-cli-tools. But in Kubuntu it isn't installed anywhere in the path. See:
You should also be able to create a menu entry or desktop shortcut and enable "Run as different user" in the properties. kdesudo is not officially part of KDE (and never was), AFAIK it is just a frontend to sudo, so I would expect it to have the same problems... And as I already mentioned, using "su -" should also work, e.g.:
Now that's strange, and I would consider that a (Kubuntu) bug.
Of course it asks for a password, it cannot just switch to root by itself (that would be a huge security issue). It doesn't use kdesudo here on openSUSE (I don't even have it installed), but kdesu. And this works fine. Maybe the code falls back to kdesudo when it doesn't find kdesu, creating a symlink should fix that then.
I checked and both bash and fish shells have this already declared.[/quote] Yeah, because it is set in the user's environment when you login to a KDE session. But apparently the apps run via sudo don't see it. If you explicitly set it in /etc/bashrc, /etc/profile or similar, it should work for root as well, but that's not really advisable either, as *all* applications then *always* think they are running in KDE even if they are not. |
Registered Member
|
I had a quick look at the code, and it does indeed try kdesudo if it cannot find kdesu. But if you have kde-cli-tools installed, it should find kdesu, as it also looks in the "libexec" location. If it doesn't find it, it's probably a packaging bug in Kubuntu. |
Registered Member
|
It works, that's how I resolved the issue in Debian Unstable. |
Registered Member
|
Yeah, because it is set in the user's environment when you login to a KDE session. But apparently the apps run via sudo don't see it. If you explicitly set it in /etc/bashrc, /etc/profile or similar, it should work for root as well, but that's not really advisable either, as *all* applications then *always* think they are running in KDE even if they are not.[/quote] True! Apparently I'm using only KDE so I don't have any side effects in my case |
Registered Member
|
Long time since I asked this, but since this is still a little un-gorgeous spot on kubuntu-17.04 waaay before it's release I just wanted to let others who run kde-exclusively on their computer know that the change to /etc/environment did indeed do the trick. Thanks for that pointer.
|
Registered Member
|
ahh, great. spent a long time looking for this info.
This Is the only way i could get mint 16.1 KDE 5.28 plasma 5.8.5 to have a dark theme on root GUI's. sudo -E partitionmanager works but nothing else does and the advise was not to use sudo). Thanks. |
Registered Member
|
An other solution is to add
Defaults env_keep += "DESKTOP_SESSION" to /etc/sudoers |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]