Bug 373796 - Partition Manager uses different config when not launched from terminal emulator
Summary: Partition Manager uses different config when not launched from terminal emulator
Status: RESOLVED DOWNSTREAM
Alias: None
Product: partitionmanager
Classification: Applications
Component: general (other bugs)
Version First Reported In: 2.2
Platform: Arch Linux Linux
: NOR minor
Target Milestone: ---
Assignee: Andrius Štikonas
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-18 02:23 UTC by tguen
Modified: 2017-01-05 17:21 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description tguen 2016-12-18 02:23:17 UTC
I don't know if this is a bug in Partition Manager itself, but it is the only app that does this AFAIK. When started from a terminal, it uses ~/.config/partitionmanagerrc. When started from a .desktop file (app menu, krunner, etc.), it uses /root/.config/partitionmanagerrc. It also doesn't use my KDE theme when started this way, which I'd assume is related.
Comment 1 Andrius Štikonas 2016-12-18 02:34:38 UTC
I am not sure if different theme is related to that... sudo does not pass environmental variables, so if you use sudo that is the most common reason for different theme. But maybe you need to set your root user theme to breeze too...

KDE Partition Manager 3.0 will help with sudo a bit, it will pass required environmental variables to kdesu in case it uses sudo as a backend.

Most likely this is distro issue. I don't reproduce this behaviour on gentoo. It always uses /root/.config/partitionmanagerrc

Maybe try to talk to Arch people, also wait and see how 3.0 will change things (should be released tomorrow). If those two options don't work, please reopen this bug.
Comment 2 tguen 2016-12-19 03:02:13 UTC
I fixed the theme issue by copying kdeglobals from ~/.config to /root/.config.

Regarding partitionmanagerrc:

If I dont use sudo, it opens kdesu. On Arch, it uses ~/.config/partitionmanagerrc (owned by root). On Neon it uses /root/.config/partitionmanagerrc. Either way it runs as root.

The Arch package maintainer and I would like confirmation on what the intended behavior is. Is it always supposed to use root's config even if it's launched from the terminal without sudo?
Comment 3 Andrius Štikonas 2016-12-19 03:17:31 UTC
Well, I wouldn't recommend running it manually (except for testing) with "sudo partitionmanager" precisely because it can rerun itself using kdesu and pass required environmental variables (sudo eats them).

As for the config file, we obviously want it to be consistent. So whichever way is easier. But I guess /root/.config might be easier since this is how it works in all other distros.

I'm actually not sure what Arch does to make it use ~/.config/. Is it some environmental variable?
Comment 4 tguen 2016-12-19 04:51:28 UTC
> I'm actually not sure what Arch does to make it use ~/.config/. Is it some environmental variable?

I have no idea, hoping the package maintainer can figure it out. Here's a link:

https://bugs.archlinux.org/task/52204
Comment 5 Andrius Štikonas 2017-01-05 17:21:22 UTC
For version 3.1 I think I'll also pass $HOME environmental variable to keep user home dir and theming. Then config will be stored in ~/.config/