gedit via Terminal (sudo gedit): Unable to remove "highlight current line" and Unable to modify preferences?

Hello Manjaro,

I use gedit text editor via terminal: For example following commands:

sudo gedit /etc/default/grub/
sudo gedit /usr/share/plymouth
sudo gedit /usr/share/gnome-shell/theme/gnome-shell.css 
.
.
.....etc

Problem:
(see image) "highlight current line" It is really annoying. I can't remove the annoying "highlight current line" I can't see nothing from the current text. Also I am unable to modify the gedit when I use the gedit with terminal....etc.

Looking forward to hearing from you
Stay Safe
Thank you in advanced

Do not run gui applications as root.
Do not use 'sudo gedit'

If your editor supports polkit and such (kate does .. maybe gedit too) - run it as normal then just hit save and it will prompt for admin password.

Otherwise use terminal-based editors like micro or nano .. and again really, you should use something like sudoedit or sudo -e rather than sudo nano as well, but much less important than
Do Not Run GUI Apps as Root/Sudo.

2 Likes

Thanks man for advice. :slight_smile:

You can use gedit from the command line. Ensure the package gvfs is installed.

gedit admin:/etc/fstab

When you are prompted for credentials - enter your password


A word of caution

When you edit files in the /usr tree - those changes will be overwritten by an update.

1 Like

Thanks, It is so strange. I hate nano, vim. I only used gedit and sudo gedit (....).

In Microsoft-Debian 10 , and even Manjaro-18:
Users can use sudo gedit and they can uncheck/check the (Highlight the current line) or change the gedit color...etc simply and easy with no headache:
sudo gedit /etc/default/grub/

Manjaro 20 and Arch 2020. I wake up and I am not able to change the GUI of gedit during using in it with the sudo commands
sudo gedit /etc/default/grub/

Remove (Highlight the current line) or changing the gedit background to see the current line.

1 Like

Thanks a lot,
I read your suggestion I agreed with you. But I would like to add this:
I knew it, They copy/paste Microsoft policy. I noticed in this new release (Fedora 32, Archlinux, Manjaro 20, Ubuntu 20.04) they used a misleading term (Security) as gas-lighting, smoking, to cover up, to messed with (Permissions, Admin privilege, Sudo, or Su....etc no sens...) to be sure that the OS will always work in way the Devs like, not users like, So the Linux OS become Frankenstein of MS (Microsoft draw the Line and Linux follow what MS does bad). This is one of many reasons why Linux was, is and will failed forever in the desktop and why MS users will never switch to Frankenstein of MS.

References
The Free Software Definition by Richard Stallman:

  • The freedom to run the program as you wish, for any purpose (freedom 0).
  • The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.
  • The freedom to redistribute copies so you can help your neighbor (freedom 2).
  • The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.

There nothing wrong with requiring administrative permissions to edit system configurations.

And you have all the freedom to do what you want.

➜  ~ su
Password: 
user@pc Linux 5.6.14-1-MANJARO x86_64 20.0.1 Lysia
/home/user >>>  gedit

Or use the su wrapper which quite possibly is available on your system - manjaro specific package named zensu.

zensu gedit /etc/fstab

or

gksu gedit /etc/fstab

Or you can use the terminal editor micro - which supports mouse selection and regular copy/paste - including source highlighting

sudo pacman -Syu micro

You have a myriad of options - freely available options to maintain your system.

If you edit files in the /usr tree - your changes will be overwritten at some point - so in that respect you do not have absolute freedom - but that is the constraints of the system.

You can't jump off high buildings without suffering the consequences either :slight_smile:

2 Likes

Just install nautilus admin that gives you a choice to open any file as admin or edit any file as admin,

1 Like

It is not about nautilus. I always used nautilus with all my DE. The problem is the Devs of Arch (Gnome), Fedora32(Gnome), Manjaro(Gnome). They copy/paste what Microsoft does wrong and they messed up with the sudo gedit (permission, supper, users privileges).

While,
I tested: Manjaro (Cinnemon, Xfce), Fedora32(Cinnamon) and Debian(All DE) everything still work fine with sudo gedit and users can read the code via gedit to modefy it(See image Debian 10 -Buster). Still everything work as usual with sudo gedit, maybe because the Devs they forget to copy paste the MS policy :slight_smile:

Sorry you are wrong nothing about Devs Gnome, KDE, have for 2 years implemented protection for user safety. Wayland does not allow root access to GUI apps get used to it Gnome, KDE, have workarounds to safegaurd the user, others just intentionally flaunt the rules, you should not expect devs to break the rules you can do it yourself that way when you fook your system up you only have you to blame.
WHY are you using Gnome 3.30 as a example that is 3 years out of date Mr not even relevant as the changes were made after that

1 Like

These are the only Rules that I follow. The Free Software Definition by Richard Stallman:

  • The freedom to run the program as you wish, for any purpose (freedom 0).

  • The freedom to study how the program works, and change it so it does your computing as you wish (freedom 1). Access to the source code is a precondition for this.

  • The freedom to redistribute copies so you can help your neighbor (freedom 2).

  • The freedom to distribute copies of your modified versions to others (freedom 3). By doing this you can give the whole community a chance to benefit from your changes. Access to the source code is a precondition for this.

When Y = X and Z = X, then Y must be equal to Z. But this is not the case....(1)

This is second image Old Debian did gnome to compare it with my first image New Arch did Gnome

In Arch-Gnome: users cant modify the gedite during the sudo gedit.
In Debian-Gnome: users can modify the gedit during the sudo gedit.

When Y = X and Z = X, then Y must be equal to Z. But this is not the case....(1)

You said Gnome of Debian is 3 Years behind. You are right Okay. What about the Debian to SID?

Debian SID and Arch they both used the current version of Gnome and current version of Wayland.

In Debian SID-with New Current Gnome with New Current Wayland; user can modify the gedit during the sudo gedit, While,

In Arch/Fedora 32,Manjaro Gnome they all used the exact New Current Gnome with New Current Wayland that Debian SID used ; But user can't modify the gedit during the sudo gedit.

When Y = X and Z = X, then Y must be equal to Z. But this is not the case....(1)

Another test I did Arch: Xfce 4 Cinnamon, vs Manjaro Xfce4, Cinnamon
Manjaro Xfce4, Cinnamon: Users can modify the gedit during the sudo gedit (see image3: User can checked and unchecked all options in Gedit during the sudo gedit ). While,
Arch: Gnome, Xfce 4 Cinnamon: Users can not modify the gedit during the sudo gedit

When Y = X and Z = X, then Y must be equal to Z. But this is not the case....(1)

Look it has nothing to do with me If you don't like something then don't use it. Its not like you paid for it, its just a piece of free software that you could build to your own specification as I and many others do, Moaning just turns users into Jonney no friends,
Sorry i have no quames with you personally, .
If cinnamon work for you better under Debian use it, Please don't try to make other distros all the same.

1 Like

I read your comments you did not give any solution. Do you have a solution or not? If you have then please reply with (commands lines). If you don't have solution then don't make it personal, just leave this post for those who are willing to help.

Bless World Bless Humanity Stay Safe Fight COVID-19

H. Jeffer

I gave you a solution in my 1st post Install nautilus-admin job done its in AUR if you are using Gnome for others you may need to edit polkit

1 Like

Thanks man. Since poklit is required then this is a serious problem and fishy. But never mind in the next Linux events we will debate this issue not behind the doors or keyboard but in face to face in public and let everyone write his/her own legacy.

Thanks again and Stay safe
H. Jeffer

You have some very strong opinions and accusations for someone just now finding out what has been standard implementation of certain softwares for years now.
And in case you havent picked up on it yet .. it isnt Arch vs. Debian or anything.
Theres nothing fishy about polkit.
Using GUI applications is root is a security problem. So is 'gtksu' and similar.
You hand the admin keys to all of X .
(as in the thing that draws stuff on your screen.. that is used by .. everything on your screen) .
This was rightly discouraged and usurped by better technology .. a good long while ago.
(I believe most notably first by KDE folks in kate and dolphin)

1 Like

Hey I just read your reply, and found it to be rather interesting! Do you have an article or smth to link? I would like to know about the security issues running GUI applications with sudo.

Thanks!

1 Like

Thanks man. To be clear I never ever inter in the Debian VS Arch or distro vs disto, and I am loyal to the linux great community. More than that in all my machines I used multiple boots, Arch, Manjaro, Debian, Fedora, Suse, Mint, Solus...etc.

Why this problem is matter?
Before, when I find problem or bugs . I send feedback to report these bugs to the devs or expert in my UNI asking for solution. As you know, to apply the solution you need terminal + text editor. I prefer the gedit as my text editor it is great, light, fast and make the job done.

Before (3 Months ago), In all distros, I faced no problem at all of using the gedit with sudo gedit to solve problems/bugs of the broken files, to create a scrip, create/modefy/fix services (e.g. Heider Jeffer Manjaro/Debian/Fedora31: Fix Bluetooth laggy connection, Heider Jeffer Nvidia manjaro intel/nvidia switch script, ..etc). It's only need few clicks Alt+T to open terminal, type sudo gedit path to broken file, modify it /fix it, save file close it, , run systemctl, inform the devs about the results. We solve all multiple problems in one terminal, in one text editor (All in One). It was fantastic

I have to be honest to our community, Brothers sisters, Now. No. I have to do the job manually (go to the folder of the broken file/Service, take the permission chmod -R a+rwx /path/to/folder of broken file/Service , then open the broken file/Service , Then change/correct the code(s) then save it and the desktop will be full of open folders, open terminals and open files, more than that; with all these opened files opened folders you must be very careful to recognized which file is to modify and which one is correct.

Bless World. Bless Humanity Stay Safe Fight COVID-19
H. Jeffer

Forum kindly sponsored by