Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running it with superuser permission doesn't use the right theme #58

Closed
Danny3 opened this issue May 4, 2021 · 8 comments
Closed

Running it with superuser permission doesn't use the right theme #58

Danny3 opened this issue May 4, 2021 · 8 comments

Comments

@Danny3
Copy link

Danny3 commented May 4, 2021

Hello!
I've tested latest version of SysmonTask (1.3.9) both normally (from desktop icon) and with superuser permission (with sudo from command line) on the latest version of Kubuntu (21.04) and I've noticed that when running with sudo the dark theme is not selected automatically like the version that I'm opening from the icon.

I'm using Breeze Dark theme that comes with Kubuntu but normally not used by default.

Could you please have a look why this this is happening ?
Or, is it possible to start the program from the desktop icon, with superuser permission (like with sudo from command line), but in a way that it doesn't request my password, but still have the dark theme and also all the necessary permissions ?

@KrispyCamel4u
Copy link
Owner

Hello!
I've tested latest version of SysmonTask (1.3.9) both normally (from desktop icon) and with superuser permission (with sudo from command line) on the latest version of Kubuntu (21.04) and I've noticed that when running with sudo the dark theme is not selected automatically like the version that I'm opening from the icon.

I'm using Breeze Dark theme that comes with Kubuntu but normally not used by default.

Could you please have a look why this this is happening ?
Or, is it possible to start the program from the desktop icon, with superuser permission (like with sudo from command line), but in a way that it doesn't request my password, but still have the dark theme and also all the necessary permissions ?

Hi,
That might be because the theme settings are not carried with the root user since both have different environments variables.
Did you try the theme setting API of sysmontask? You can find out about it in readme
Let me know if it work for you.

@KrispyCamel4u
Copy link
Owner

Can you update me regarding the issue if you still have it?

@Danny3
Copy link
Author

Danny3 commented May 7, 2021

Tried this:
sudo sysmontask.set_dark
Index for Corresponding Theme that you want to apply?:0
Failed to set Theme:(
Run with sudo(root privileges) is required.

Tried the same command again because I didn't see it asking for my password before and looked like it worked:
Index for Corresponding Theme that you want to apply?:0
Setting of Dark Theme Done:)

But running sudo sysmontask gain still shows with light theme

So I tried:
sudo sysmontask.set_dark
Index for Corresponding Theme that you want to apply?:1
Setting of Dark Theme Done:)

But the same, sudo sysmontask still shows up with the light theme

@KrispyCamel4u
Copy link
Owner

Tried this:
sudo sysmontask.set_dark
Index for Corresponding Theme that you want to apply?:0
Failed to set Theme:(
Run with sudo(root privileges) is required.

Tried the same command again because I didn't see it asking for my password before and looked like it worked:
Index for Corresponding Theme that you want to apply?:0
Setting of Dark Theme Done:)

But running sudo sysmontask gain still shows with light theme

So I tried:
sudo sysmontask.set_dark
Index for Corresponding Theme that you want to apply?:1
Setting of Dark Theme Done:)

But the same, sudo sysmontask still shows up with the light theme

Hi, on my system(PopOs 20.10) theme setting API works.
What is the list of available themes(which gets list when you run sudo sysmontask.set_dark)?
Set it back to default via sudo sysmontask.set_default
Try running the below command:
GTK_THEME=<theme name from the list> sysmontask
and then
sudo GTK_THEME=<theme name from the list> sysmontask
Let me know the status of these commands.

@Danny3
Copy link
Author

Danny3 commented May 10, 2021

"What is the list of available themes(which gets list when you run sudo sysmontask.set_dark)?"
It says this:
[sudo] password for my-username: Index for Corresponding Theme that you want to apply?:
"Set it back to default via sudo sysmontask.set_default"
Done!
Setting to default: Done:)

I cannot follow the others as I don't know what the theme names are.

I don't know if it's any help but running it again looks like this:
sudo sysmontask
5.8.0
cpuInit
memory tab initialising
sda
sdb
/bin/sh: 1: nvidia-smi: not found
no nvidia gpu found
save button
update Dir right True
update speed to normal
initialisating sidepane
total window 1.595869541168213
hello
appending 6549
.......................... (multiple appending and number)

@KrispyCamel4u
Copy link
Owner

"What is the list of available themes(which gets list when you run sudo sysmontask.set_dark)?"
It says this:
[sudo] password for my-username: Index for Corresponding Theme that you want to apply?:
"Set it back to default via sudo sysmontask.set_default"
Done!
Setting to default: Done:)

I cannot follow the others as I don't know what the theme names are.

I don't know if it's any help but running it again looks like this:
sudo sysmontask
5.8.0
cpuInit
memory tab initialising
sda
sdb
/bin/sh: 1: nvidia-smi: not found
no nvidia gpu found
save button
update Dir right True
update speed to normal
initialisating sidepane
total window 1.595869541168213
hello
appending 6549
.......................... (multiple appending and number)

Hi,
There is a small bug in sysmontask.set_dark API which I have found.
To resolve your issue for now run sysmontask.set_light there you will find the dark theme listed. In my case on Kubuntu VM it was Breeze-Dark select that index and it will work with sudo.
The other way of doing this is via KDE settings->Application Style->Configure Gnome/Gtk Application. There you can select any dark theme for the GTK3 application.

Hope it will resolve your issue. Let me know in any case.

@Danny3
Copy link
Author

Danny3 commented May 20, 2021

There is a small bug in sysmontask.set_dark API which I have found.
To resolve your issue for now run sysmontask.set_light there you will find the dark theme listed. In my case on Kubuntu VM it was Breeze-Dark select that index and it will work with sudo.

True, it worked just as you said !
0 : Breeze
1 : Breeze-Dark
2 : Default
3 : Emacs
4 : Raleigh
Index for Corresponding Theme that you want to apply?:1
Setting of Light Theme Done:)

The message is a bit funny for Breeze-Dark :)

Running sudo sysmontask now opens up with the dark theme and it's great !

Thank you very much !

"The other way of doing this is via KDE settings->Application Style->Configure Gnome/Gtk Application. There you can select any dark theme for the GTK3 application."

I knew about this and I had it configured as Breeze dark before, but on recent KDE Plasma version I cannot find this theme in the drop-down menu and now I'm running the beta version for the next Plasma release (5.22).

I think I might have to ask the KDE Plasma developers on what they did since I cannot find it anymore.

@KrispyCamel4u
Copy link
Owner

Hey, the new release is out with this bug fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants