Presumably there is a way of editing config.txt from within the LXDE GUI? I'm still trying to tweak my TV display settings and rather than keep taking the SD card out and to my Windows machine for every minor tweak I was looking for a way of doing it within LXDE.
I've found the LeafPad text editor and can obviously make the text changes, but I'm not allowed to overwrite config.txt, presumably because of a permissions issue?
Is the only simple option to keep using the Windows PC for the edits?
- frying_fish
- Posts: 80
- Joined: Mon Jan 23, 2012 3:26 pm
Re: Editing config.txt
You could use a command line text editor, or, run leafpad with elevated permissions.
From a terminal application:
$ sudo leafpad
That would then open leafpad as a root user, and you should then be able to edit config.txt, assuming the partition it is on is mounted read/write. I haven't received my Pi yet so just going from normal linux commandline knowledge.
From a terminal application:
$ sudo leafpad
That would then open leafpad as a root user, and you should then be able to edit config.txt, assuming the partition it is on is mounted read/write. I haven't received my Pi yet so just going from normal linux commandline knowledge.
-
- Posts: 4277
- Joined: Sun Jan 15, 2012 1:11 pm
Re: Editing config.txt
I think you have to use sudo regardless of which editor you use.
Presumably, the issue is that the FAT partition is mounted in such a way that it is writable only by root.
By the way, is the FAT partition mounted by default (once you are up and running in Linux) ? It's been a while, but it seems to me that it wasn't. I suppose I could check.
Presumably, the issue is that the FAT partition is mounted in such a way that it is writable only by root.
By the way, is the FAT partition mounted by default (once you are up and running in Linux) ? It's been a while, but it seems to me that it wasn't. I suppose I could check.
And some folks need to stop being fanboys and see the forest behind the trees.
(One of the best lines I've seen on this board lately)
(One of the best lines I've seen on this board lately)
Re: Editing config.txt
Thanks. As a newcomer to Linux, I first thought that a terminal application might be the command prompt, which didn't work. Then tried the root terminal app, but I don't seem to have a password for that. Then LXTerm, which I guess should have been the obvious choice in retrospect, which did work (except that you seem to have to Save As rather than just Save).
-
- Posts: 239
- Joined: Thu Jan 12, 2012 5:45 pm
Re: Editing config.txt
I've asked about getting GUI applications such as Leafpad and the file monitor to get admin access on a number of occasions and as far as I can tell it can't be done. You need to forget about the last 20 years of UI design and get into the terminal.
Then, to get root access (which is Linux speak for Admin) you need to prefix commands with sudo.
If you save your modified file to your user area, then start a terminal, you can use a command such as:
sudo cp source destination
Where source is the name of the file such as xorg.conf and destination is the destination, such as /etc/X11 (or possibly /etc/X11/xorg.conf) I used:
sudo cp xorg.conf /etc/X11/xorg.conf
Note that everything is case sensitive. The cp command copies files, the mv command moves files. It's all far more complex than this of course.
That's an example of what I had to do to get a version of xorg.conf to set a resolution of 800x600 on the display, if your file name or destination is different you will need to make the obvious changes.
Hope that helps, this is not at all easy if you are used to a modern GUI.
Then, to get root access (which is Linux speak for Admin) you need to prefix commands with sudo.
If you save your modified file to your user area, then start a terminal, you can use a command such as:
sudo cp source destination
Where source is the name of the file such as xorg.conf and destination is the destination, such as /etc/X11 (or possibly /etc/X11/xorg.conf) I used:
sudo cp xorg.conf /etc/X11/xorg.conf
Note that everything is case sensitive. The cp command copies files, the mv command moves files. It's all far more complex than this of course.
That's an example of what I had to do to get a version of xorg.conf to set a resolution of 800x600 on the display, if your file name or destination is different you will need to make the obvious changes.
Hope that helps, this is not at all easy if you are used to a modern GUI.
- frying_fish
- Posts: 80
- Joined: Mon Jan 23, 2012 3:26 pm
Re: Editing config.txt
Joe Schmoe said:
I think you have to use sudo regardless of which editor you use.
Correct, I forgot to mention that sorry. Indeed you need to be root, or have admin rights (in this case sudo gives the default user those rights).
I think you have to use sudo regardless of which editor you use.
Correct, I forgot to mention that sorry. Indeed you need to be root, or have admin rights (in this case sudo gives the default user those rights).
Re: Editing config.txt
After logging in to the Pi, no need to start the GUI, just use this:
$ sudo nano /boot/config.txt
That will do the trick. Use ctrl-o to write the changes and ctrl-x to exit the nano text editor.
Nano is really easy to use, even as a Linux Noob (Like me).
$ sudo nano /boot/config.txt
That will do the trick. Use ctrl-o to write the changes and ctrl-x to exit the nano text editor.
Nano is really easy to use, even as a Linux Noob (Like me).
Re: Editing config.txt
Blimey - somebody in Chatteris!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: Editing config.txt
JamesH said:
Blimey - somebody in Chatteris!
Thought I'd fess up.
Do you know Chatteris?
Blimey - somebody in Chatteris!
Thought I'd fess up.
Do you know Chatteris?
Re: Editing config.txt
I live just up the road (and grew up in Sutton)....
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.
Re: Editing config.txt
JamesH said:
I live just up the road (and grew up in Sutton)....
I see prodata is from Ely too, it's a small world.
I live just up the road (and grew up in Sutton)....
I see prodata is from Ely too, it's a small world.
-
- Posts: 7
- Joined: Tue Jun 14, 2016 8:50 pm
Re: Editing config.txt
Sooner or later you are going to have to get used to using either the GUI with root access or use nano or another terminal text editor with root privileges.
If using a text editor editor like mousepad or leafpad....Just go to terminal type in sudo and the name of the editor. You will be prompted to enter your password.
If using nano, vi, or vim, or some other terminal text editor open a terminal type sudo and the editor's name. I use nano and it is like this.
sudo nano then path to file.
The easiest way...I think is to open your file manager as root ...
sudo thunar you will be prompted for password and go from there. When you find your file you can right click and the menu will let you open a terminal there. That is easier for me..
If using a text editor editor like mousepad or leafpad....Just go to terminal type in sudo and the name of the editor. You will be prompted to enter your password.
If using nano, vi, or vim, or some other terminal text editor open a terminal type sudo and the editor's name. I use nano and it is like this.
sudo nano then path to file.
The easiest way...I think is to open your file manager as root ...
sudo thunar you will be prompted for password and go from there. When you find your file you can right click and the menu will let you open a terminal there. That is easier for me..
Re: Editing config.txt
Some GUI applications that are started from the command line need a different call in order to run as a super user.
gksudo is what you would use to launch GUI based applications.
gksudo is what you would use to launch GUI based applications.
You can run, but you will only die tired.
- HawaiianPi
- Posts: 6134
- Joined: Mon Apr 08, 2013 4:53 am
- Location: Aloha, Oregon USA
Re: Editing config.txt
It's actually quite easy to do. See below...Chris.Rowland wrote:I've asked about getting GUI applications such as Leafpad and the file monitor to get admin access on a number of occasions and as far as I can tell it can't be done...
Or "gksu"Romonga wrote:Some GUI applications that are started from the command line need a different call in order to run as a super user.
gksudo is what you would use to launch GUI based applications.
gksu leafpad /boot/config.txt
or
gksudo leafpad /boot/config.txt
Substitute geany or whatever GUI application you prefer for leafpad.
You can even add a root file manager to the menu.
Preferences > Main Menu Editor > Accessories, you should already see an entry for Root Terminal that is not enabled by default. Since we're going to start living dangerously, go ahead and check that box. Now click on New Item and fill it out like the picture below (click on the picture for full size, and use back to return here). You can also click on the icon image to change that.

And there you go. Now, whenever you want to edit a text file that is outside your home directory, just fire up the root file manager from the menu, navigate to the file and double-click on it. It will open in the editor with admin rights and you can edit to your heart's content.
Do not use the root file manager in your home directory, and be careful outside of that. You could really hose your system with a few errant mouse clicks.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?
lots of pop-ups...and where is that annoying music coming from?
Re: Editing config.txt
I just click on the terminal windows in the taskbar or menu system and type (arrow up if just used)
sudo leafpad /boot/config.txt to launch and edit it in one go.
Which is the method on the Raspberry make and learn website
Also used to edit the last startup file/script as an example
sudo leafpad /etc/rc.local
Given by them
What benefit just gksudo give?
sudo leafpad /boot/config.txt to launch and edit it in one go.
Which is the method on the Raspberry make and learn website
Also used to edit the last startup file/script as an example
sudo leafpad /etc/rc.local
Given by them
What benefit just gksudo give?
Re: Editing config.txt
Indeed. And that advice was given to the Original Poster within an hour or so of the question being asked 4 years ago.Gretchen2015 wrote:Sooner or later you are going to have to get used to using either the GUI with root access or use nano or another terminal text editor with root privileges.
@prodata - the OP - has not logged on to the forums for over 2 years.