BigJeffIE
Posts: 26
Joined: Fri May 11, 2012 7:55 pm

Running Idle as root from desktop

Sun Sep 09, 2012 7:09 pm

Hi folks,

I'm using IDLE to have a go at programming in Python. Even though there's an icon on the desktop I can't use it because I need it to run as root.

How do I get the icon to run as root instead of having to open a terminal window and doing sudo idle.

Thanks,

Chris

JeremyF
Posts: 515
Joined: Wed Jan 25, 2012 9:06 pm
Contact: Website

Re: Running Idle as root from desktop

Sun Sep 09, 2012 10:57 pm

Hi Chris!

You can create a very simple bash script to do this:
  • 1. Open a terminal
    2. type cd ~/Desktop
    3. type touch IDLE_as_root
    4. type nano IDLE_as_root
    5. type in sudo idle
    6. exit nano
    7. type in sudo chmod +x IDLE_as_root
    8. Close terminal
    9. Double click on the IDLE_as_root program on your desktop
{sig} Setup: Original version Raspberry Pi (B, rev1, 256MB), Dell 2001FP monitor (1600x1200), 8GB Class 4 SD Card with Raspbian and XBMC, DD-WRT wireless bridge

BigJeffIE
Posts: 26
Joined: Fri May 11, 2012 7:55 pm

Re: Running Idle as root from desktop

Mon Sep 10, 2012 9:02 am

and thanks again Jeremy.

This will make life easier.

Regards,

Chris

legaborgo
Posts: 1
Joined: Fri May 03, 2013 6:47 am

Re: Running Idle as root from desktop

Fri May 03, 2013 6:54 am

Hi,

I liked this only: (change: sudo idle)
/usr/bin/gksu -u root idle

legaborgo

layer7
Posts: 1
Joined: Thu Dec 05, 2013 1:56 pm

Re: Running Idle as root from desktop

Thu Dec 05, 2013 2:00 pm

If you want to always run IDLE with root privs then simply edit the desktop link entry in ~/Desktop and change the following line:
Exec=/usr/bin/idle
to
Exec=sudo /usr/bin/idle
You will then be able to just open idle in the normal way from your desktop and it will have root privs.

pythonnoob123
Posts: 16
Joined: Wed Jul 02, 2014 11:16 am

Re: Running Idle as root from desktop

Fri Jul 04, 2014 11:22 am

"simply edit the desktop link entry in ~/Desktop and change the following line:
Exec=/usr/bin/idle
to
Exec=sudo /usr/bin/idle"


how do I do that? I'm a total noob.

Mamvcivm
Posts: 8
Joined: Sun Mar 09, 2014 11:04 am

Re: Running Idle as root from desktop

Tue May 03, 2016 8:43 pm

layer7 wrote:If you want to always run IDLE with root privs then simply edit the desktop link entry in ~/Desktop and change the following line:
Exec=/usr/bin/idle
to
Exec=sudo /usr/bin/idle
You will then be able to just open idle in the normal way from your desktop and it will have root privs.
Hi,I did this by opening the properties of the IDLE file in /home/pi/Desktop. I went to the Desktop Entry tab and prefixed the command with sudo, ie sudo /usr/bin/idle3 for Python 3 (IDLE), however this didn't work.

Any advice please?

Cheers,

Andy

User avatar
penguinmanraspberry
Posts: 12
Joined: Fri Jul 05, 2013 10:31 am

Re: Running Idle as root from desktop

Mon May 01, 2017 4:39 am

Both 'Solutions' in this thread do not work.

The first solution 'create a text file link on the desktop' won't execute anything it will just open the text file with an editor.

The second solution recommends editing a file in ~/Desktop that doesn;t exist.

We require a right-click context menu that says 'Create shortcut'
Do it.

User avatar
B.Goode
Posts: 10356
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Running Idle as root from desktop

Mon May 01, 2017 9:10 am

With apologies if you have a specific requirement and already know better, but things have moved on a lot since this topic was opened nearly 5 years ago, and for many purposes there is no longer a need to run Idle as root. Are you sure you actually need to do this?

Return to “Beginners”