Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

gksudo is not taking full focus – python, glade

Ubuntu 18.04.6 LTS.
I got this script in python, and its uses Glade as a gui.

Here is the main file:
https://github.com/stuk88/UbuntuClearMemoryCache/blob/master/main.py

So.
The code at fault here is:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

runAsRoot("gksudo sysctl vm.drop_caches=1")

And I dont know why dksudu is not taking focus.
Switching windows with alt+` is not working either.

>Solution :

You are trying to run a terminal command with gksudo. That will start the process, but of course leave you no way of interacting with it. You probably rather want to launch a terminal application, in which that command is started.

Note that gksudo to start graphical applications is deprecated. Use pkexec, but better, prefer not to run a graphical application as root at all: have it elevate to root privileges only while actually performing the specific actions that require root permissions.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading