I would like to set IDLE as the default editor for python scripts, but when I click on "open with application" and hit the dropdown to show more applications it isn't an option.
Here's exactly what I am doing…
- right-click on .py file on my desktop.
- Right click on properties.
- Click on the Open with tab.
There is no "Use a custom command" option. The same thing happens when I right click on the file and select "open with other application".
Do you of any way I could set this up?
Best Answer
You didn't mention which idle package you are using, let's assume "Idle". If using "Idle3" then use
idle3.desktop
below. If using "Idle(using Python-2.7)" then useidle-python2.7.desktop
There are 2 things preventing you from finding idle in the context menus -
First none of the idle .desktops have a MimeType= line in them, that's why Idle doesn't show in the r. click > open with ... menu
Additionally - only .desktops whose Exec= line ends with a %letter will show in the r. click > properties context menu, even if they show up in the above 'open with' menu
So in this case easiest to just do this - first add to the open with menu
In the [Added Associations] section look for this line
text/x-python=
If there then add this to the end
If not there then just add
Idle should now be available in the open with menu, if not log out/in
While there, in the [Default Applications] section look for the same line & replace the .desktop as such, if not there just add the line ( no
;
is used in the Defaults sectionIf Idle doesn't show up as the default, even after a restart then you'll need to 'force' it. I'd prefer this way rather than messing with defaults.list
open the .desktop in a root editor
Add a %f to the end of the line, save - like
Then ck. again & see if Idle is now the default, do a log out/in if needed. Once it's added then you can reopen idle.desktop & remove the %f, it should stay as default. I'm not sure if %f is appropriate for idle, otherwise I'd say you could leave it