I was trying to use gedit to edit a file called ‘google.xml’ which is a searchplugin for Firefox. When I typed gedit A message appeared saying that gedit couldn’t open the display. I have previously had a few problems with my OpenSuse installation and got that message then as well. I have since reinstalled OpenSuse and I thought that the problems were now cleared up but I still have that error message about gedit. What does it mean and what can I do about it?
Also, I was trying to edit something using vi and when I wanted to quit and save the file, typing a colon didn’t work. According to a vi manual that I found by googling, typing a colon followed by wq should put the cursor at the end of the file, save the file end exit vi. What am I doing wrong? I had previously typed sudo vi but got an error message so I don’t think I have sudo installed - how can I fund out? Perhaps OpenSuse doesn’t use it? I was able to edit the file in the end by doing su - and then entering my password but I thought I should be able to do what I wanted by typing sudo vi
When your display can not be opened it often means that the program trying to open it is not run by the same user as the one that is running the display. This often happens when in a GUI session (of a normal user), root tries to start a GUI program. Is that the case here? (Yes, root is not omnipotent, the user can, and does by default, block others, including root, from opening windows on his display).
I do not quite understand the vi story. Do you mean that when you typed a : it did not show in the lower left corner?
Please post entire commands and paths when giving examples. Saving a file
in any application would fail if the file you were trying to save was one
to which you did not have rights. In ‘vi’ you can add a bang (exclamation
mark/point (!)) to force it to save assuming you are powerful enough
(‘root’ or the owner of the file) but that’s probably not an option in
gedit. Also as mentioned you cannot always log a GUI app as ‘root’ unless
you do a few other things first, but it sounds like you will be on the
right track with the others’ comments. ‘gnomesu’ and ‘kdesu’ are the apps
for Gnome and KDE, respectively, to load applications as root in the GUI.
Good luck.
chris pasdecalais wrote:
> Hi,
>
> I was trying to use gedit to edit a file called ‘google.xml’ which is a
> searchplugin for Firefox. When I typed gedit A message appeared saying
> that gedit couldn’t open the display. I have previously had a few
> problems with my OpenSuse installation and got that message then as
> well. I have since reinstalled OpenSuse and I thought that the problems
> were now cleared up but I still have that error message about gedit.
> What does it mean and what can I do about it?
>
> Also, I was trying to edit something using vi and when I wanted to quit
> and save the file, typing a colon didn’t work. According to a vi manual
> that I found by googling, typing a colon followed by wq should put the
> cursor at the end of the file, save the file end exit vi. What am I
> doing wrong? I had previously typed sudo vi but got an error message so
> I don’t think I have sudo installed - how can I fund out? Perhaps
> OpenSuse doesn’t use it? I was able to edit the file in the end by doing
> su - and then entering my password but I thought I should be able to do
> what I wanted by typing sudo vi
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Hi HCW, yes when I typed the colon, all that happened was that the colon remained at the end of the line I had entered. It didn’t go to the bottom left of the screen, but since logging on this morning I have read deano_ferrari’s message (thanks very much) and have put a colon followed by qw! and it worked. As to sudo, typing sudo visudo results in “sudo: visudo: command not found”. I read somewhere that that is the command to use in order to edit the sudoers file.
Thanks too swerdna, putting gnomesu worked but I have to say that openSuse seems to be full of arcana. Psuerhaps it takes more than a week to find out about it all!
You’re using vi, not knowing how vi works. If the : appears in the text, you’re still in ‘insert mode’. Hit Esc, and then “:w!” and it will write. Also in Esc-mode you can do “ZZ”, vi will write and close the file.
But…do yourself a favor and use gedit, kedit, kwrite or whatever. I use vi because that was what i learned when i started administrating UNIX machines. I still use it because i’m used to it, nothing else.
you were most probably still in “insert” more or text entry mode.
you have to press the “Esc” key to go to command mode
then you can type commands like :q, :wq etc.,
You are absolutely right, Knurpht, but it is a long story; I wanted to edit a file, and typing sudo gedit wouldn’t work so I thought that I didn’t have the right permissions. Floundering around in Google I came across the idea that I might need to put my user name into the sudoers file which,said the Google page, is done by typing sudo visudo. This didn’t work but typing su - (thanks confuseling) followed by visudo did so I then looked on the web for a vi manual and the one that I found didn’t mention escape mode…hence my problem. Anyway “Experientia docet” as the Ancient Romans used to say and thanks for your message