1

I am trying to associate files with Notepad++ running under PlayOnLinux on Kubuntu 13.10.

(Yes, I am aware that there are plenty of equivalent programs that may be used in Kubuntu. The reason I want to use Notepad++ is because we are using it at university and I want consistency)

I have followed the instructions in this article, right up to the point where it says to open with other applications. But I do not see Notepad++ listed anywhere on the list. How do I add it to the list of applications (categories) in Kubuntu?

SamuelH
  • 826
  • 2
  • 10
  • 22
  • How do you normally open it - and where is the executable exe located? – Wilf Feb 22 '14 at 12:31
  • What are you referring to when you say "How do I normally open it"? If you mean Notepad++, it runs on PlayOnLinux, so I either go into PlayOnLinux and open it there, or I use the desktop shortcut. I copied this shortcut to /usr/share/applications as explained in the article. The .exe itself is in (myhomedrive)/PlayOnLinux's virtual drives/NotepadPlusPlus/drive_c/Program Files/Notepad++/ – SamuelH Feb 22 '14 at 12:33
  • As an update, if I right-click on a file, and go Open With > Other... I can then browse to the location above and choose Notepad++.exe. But I don't want to have to do that every time I open something like an HTML, SQL or PHP file for editing. Can I add Notepad++ to the list of known applications? – SamuelH Feb 22 '14 at 12:38

1 Answers1

0

Find the Notepad++ .desktop launcher file - the one you put in /usr/share/applications - it will look like this:

[Desktop Entry]
Encoding=UTF-8
Name=Notepad++
Comment=PlayOnLinux
Type=Application
Exec=/usr/share/playonlinux/playonlinux --run "Notepad++" %F
Icon=/home/USERNAME/.PlayOnLinux//icones/full_size/Notepad++
Name[fr_FR]=Notepad++
MimeType=application/x-cgi;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/x-javascript;application/x-perl;application/x-php;application/x-python;application/xhtml+xml;application/xml;text/css;text/html;text/javascript;text/mathml;text/plain;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-diff;text/x-dsrc;text/x-dtd;text/x-java;text/x-javascript;text/x-pascal;text/x-perl;text/x-php;text/x-python;text/x-sql;text/xml;
StartupWMClass=notepad++.exe
Categories=

add/change these lines:

Categories=Text;Editor;Plaintext;Write;GTK;Development;IDE;
MimeType=text/plain;text/x-chdr;text/x-csrc;text/x-c++hdr;text/x-c++src;text/x-java;text/x-dsrc;text/x-pascal;text/x-perl;text/x-python;application/x-php;application/x-httpd-php3;application/x-httpd-php4;application/x-httpd-php5;application/xml;text/html;text/css;text/x-sql;text/x-diff;

Then right click on the file you want, and go to 'Properties' then to the 'Open With' tab:
You can find Notepad++ and

You can then find Notepad++, and either 'Add' or 'Set is as Default'

Then you can open it with Notepad++ as default
enter image description here

Wilf
  • 30,194
  • 17
  • 108
  • 164
  • It worked! You sir, are a genius! Actually I also noticed that now if I create, say, a .html file on my desktop and right click and go Open With, Notepad++ appears there at the bottom of the list so I don't even have to go "Other" any more! – SamuelH Feb 22 '14 at 12:55
  • Also, of you are using Dolphin, the KDE file manager, you just need to go to 'Open With' and at the top enter /usr/share/playonlinux/playonlinux --run "Notepad++" %F - dunno how you set that as default though - glad it worked, mark it as answered if you think it is. – Wilf Feb 22 '14 at 12:57