1

Im new in Linux world, and i have a problem what is cant solve for like 17 hours.

Im using Ubuntu 18.04.3.

I would like to edit my files from the gui, because i don't want to use the nano, or mcedit every time i have to edit some config file.

So i downloaded Notepadqq (not the snap version!), and created a "shortcut" for it:

#!/usr/bin/env xdg-open

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Exec=/usr/local/bin/notepadqq
Name[en_US]=Notepadqq
Name=Notepadqq
Icon=notepadqq

also in the /usr/local/bin i created a bash script named notepadqq, what contains:

#!/bin/bash
/usr/bin/notepadqq --allow-root $*
exit $?
###eof###

So this route (/usr/locl/bin) is the second in my $PATH, so this will run before the "real notepad" if i think it right.

I gave it my username with chown

chown myusername:myusername notepadqq

and set the read-write priviliges too

chmod 0755 notepadqq

So my plan was to run Notepadqq always as root.

But it dont works. The terminal script: 'sudo notepadqq' is works very well, but now what's the matter with --allow-root, if i have to 'sudo' to use the flag --allow-root? :D

i tried this:

[Desktop Entry]
...
Exec=pkexec gedit /usr/local/bin/notepadqq

but it's not works. When i try this at the terminal (pkexec gedit notepadqq) i get this error:

Unable to init server: Could not connect: Connection refused

Now i shot all my thoughts, i dont know what to do.

Does anyone have any clues?

  • 1
    First you download a third-party app and then you run that app always as root. yikes! – karel Dec 17 '19 at 09:07

0 Answers0