@Dave92F1,
I was hoping the NP++ community would have experience with this, since I gather that NP++_on_Wine is sort of the “official” way to run NP++ on Linux.
Notepad++ is an application for Windows ; no other usage is official nor even “official”. If you can get it to work in another environment (like Wine), then lucky you.
Elsewhere I’ve been advised that “the only way” to do this is to take ownership of the file, edit it, then restore ownership back to root. I’m not sure if that’s practical (I’d have to find a way to do it in a script).
I am not a linux-sudo expert, but the sudo permissions should be sufficient to run a script that changes the owner of a file, makes a change, then changes it back – at least, I cannot imagine how that wouldn’t work, since root (and thus sudo) has the ability to change permissions on any file. I mean, if I’ve understood correctly, the script could probably be as simple as
sudo chown username /etc/rc.local
notepad-plus-plus /etc/rc.local
sudo chown root /etc/rc.local
Do not take my word as “golden” or “authoritative” or “official” on this. I’ve never done such a thing. And there are probably security implications of changing the owner, even temporarily.
----
edit: Ooh, another idea: copy it to a temp file before changing permission, so no one else ever has permission on the real file
sudo cp /etc/rc.local /tmp/editable.rc.local
sudo chown username /tmp/editable.rc.local
notepad-plus-plus /tmp/editable.rc.local
sudo chown root /tmp/editable.rc.local
cp /tmp/editable.rc.local /etc/rc.local
That might be better, though there are probably still security considerations on that. Using a meaningless/random tmpfile name would probably be better than /tmp/editable.rc.local, so that it’s not obvious to an outsider watching the /tmp filestructure that the file is being used for editing rc.local