(Solved) Unable to open Notepadqq as root

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Pippin
Level 4
Level 4
Posts: 441
Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire

(Solved) Unable to open Notepadqq as root

Post by Pippin »

Hi,

Since last update of Notepadqq I can`t open files as root in Nemo.
So I open Nemo as root double click a text file and nothing happens.

I have to do
~ # notepadqq --allow-root &
as root to open Notepadqq and then browse to the file to open it,... it`s cumbersome.

Is there a way that can be reverted?

Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
Mute Ant

Re: Unable to open Notepadqq as root

Post by Mute Ant »

Before you rush in, why do the authors of notepadqq not want it to have root access? Maybe it can't be trusted? When you know that and you are happy to ignore the default, you can write your own version of the command in bash positioned so the shell finds it and runs it before it finds the real binary.

Typically executable files in /usr/local/bin/ are searched before the installed binaries in /usr/bin/ and the command...
echo $PATH
...will show you the order that your particular shell is using.

For example, a wrapper script could be called /usr/local/bin/notepadqq and contain something like...

Code: Select all

#!/bin/bash
/usr/bin/notepadqq --allow-root $*
exit $?
###eof###
User avatar
Pippin
Level 4
Level 4
Posts: 441
Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire

Re: Unable to open Notepadqq as root

Post by Pippin »

Ok, nice trick, thanks.

I`m happy to ignore the defaults ;)

notepadqq is in:

Code: Select all

/usr/bin/notepadqq
The path order shows:

Code: Select all

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin
So, I place your script in

Code: Select all

/usr/local/bin
gave it

Code: Select all

chmod 0755
and it works.

Thanks again.
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
Mute Ant

Re: Unable to open Notepadqq as root

Post by Mute Ant »

Good. If you could edit the title of your original post to include the text (solved) other people will find it more easily.
User avatar
Pippin
Level 4
Level 4
Posts: 441
Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire

Re: Unable to open Notepadqq as root

Post by Pippin »

Hi,

Would like to mark it as solved but...

When opening New Document.txt it will create two new files, New and Document.
Didn`t think of that one

Changing your script to

Code: Select all

#!/bin/bash
/usr/bin/notepadqq --allow-root "$*"
exit $?
###eof###
solved that one.

Marked solved ... for now :)

Thanks.
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
arvY99
Level 3
Level 3
Posts: 102
Joined: Sat Sep 10, 2016 6:10 am

Re: (Solved) Unable to open Notepadqq as root

Post by arvY99 »

Simply thanks to both of you!

Had the same problem. Uninstalled notepadqq and re-installed it, thinking that something was broken and about to ask some help...

Solved here too! :wink:
User avatar
Pippin
Level 4
Level 4
Posts: 441
Joined: Wed Dec 13, 2017 11:14 am
Location: The Shire

Re: (Solved) Unable to open Notepadqq as root

Post by Pippin »

Glad it works for you, I never had to look back, still working.
I gloomily came to the ironic conclusion that if you take a highly intelligent person and give them the best possible, elite education, then you will most likely wind up with an academic who is completely impervious to reality.
Halton Arp
Locked

Return to “Software & Applications”