PINE64
Can't find "sudo gedit" alternative - Printable Version

+- PINE64 (https://forum.pine64.org)
+-- Forum: PinePhone (https://forum.pine64.org/forumdisplay.php?fid=120)
+--- Forum: PinePhone Software (https://forum.pine64.org/forumdisplay.php?fid=121)
+---- Forum: PostmarketOS on PinePhone (https://forum.pine64.org/forumdisplay.php?fid=124)
+---- Thread: Can't find "sudo gedit" alternative (/showthread.php?tid=11336)



Can't find "sudo gedit" alternative - mh4it - 09-08-2020

How can I edit a admin text file with Phosh?  Cant seem to find how to edit a file as root.


RE: Can't find "sudo gedit" alternative - ThrillGates - 09-08-2020

In Phosh, you can go to Settings > Applications to view a list of installed applications. I'm running Mobian and gedit is listed as "Text Editor". You can open the app in software manager for more detail, like its actual name.


RE: Can't find "sudo gedit" alternative - mh4it - 09-08-2020

I can't execute the command in Phosh for some reason!  Nothing opens.

Response from Alpine Linux Chat:
"<user1> Please don't launch GUI apps with root
<user1> Doesn't work on any Wayland environment
<user1> You could make a simple bash script that copies the file to $(mktemp -d)/file, opens that with gedit and sudo cp the temp file
<user2> EDITOR=gedit sudoedit?
<user1> Right, that does basically that, right?"


RE: Can't find "sudo gedit" alternative - User 18618 - 09-10-2020

Indeed, please don't escalate the privileges of text editors. Use one of these (identical) commands instead:

Code:
sudo -e || sudoedit

If you're using Bash, try this:

Code:
printf '%b' "export EDITOR=gedit\nexport VISUAL=gedit\n" | tee -a ~/.profile
. ~/.profile && echo $EDITOR $VISUAL
sudo -e /path/to/file