Announcement

Collapse
No announcement yet.

Problems writing scripts or files to directories.

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [PLASMA 5] Problems writing scripts or files to directories.

    When ever I have to make an adjustment to a file or throw in a shell script into the root directory using sudo leafpad I get this error:

    johnb@home:~$ sudo leafpad /etc/profile.d

    (leafpad:2899): Gtk-WARNING **: 17:47:37.379: Unable to locate theme engine in module_path: "adwaita",

    (leafpad:2899): Gtk-WARNING **: 17:47:37.385: Unable to locate theme engine in module_path: "adwaita",

    ** (leafpad:2899): WARNING **: 17:47:49.919: Invalid borders specified for theme pixmap:
    /usr/share/themes/Breeze/gtk-2.0/../assets/line-h.png,
    borders don't fit within the image

    If I try to use kate, I get this error:

    johnb@home:~$ sudo kate /etc/profile.d
    [sudo] password for johnb:
    Executing Kate as root is not possible. To edit files as root use:
    SUDO_EDITOR=kate sudoedit <file>

    Can anyone possibly direct me to the correct way to make a new file into a root directory, usually the /etc directory or edit one already there, the proper linux way through the cli? I just had to put in a shell file into profile.d for KWIN_TRIPLE_BUFFER=1, and had to manually make a file, and drop it into the folder. there has to be a correct way than that.

    Thanks for reading.

    #2
    Just launch Kate and open the file in question. When you Save the file, and it's owned by root, you will be prompted for your password. Provide that and the file will be saved.
    Last edited by Snowhog; Nov 06, 2018, 10:02 AM.
    Windows no longer obstructs my view.
    Using Kubuntu Linux since March 23, 2007.
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    Comment


      #3
      Leafpad? It's GTK and Plasma is built on QT so you can expect those warnings (not errors) just about anytime you launch a GTK program. A lot of people have a hard time adjusting the the new paradigm of NOT launching Kate or Dolphin using sudo, but once you get used to it you'll be OK. If you really need to be root a lot of the time, you can always create a root account and use it.

      Please Read Me

      Comment


        #4
        I always liked Leafpad as a text editor, but time to move on. Kate is excellent for writing plain text, scripts, C++ source code, you name it. On the command line, I use nano. There may be better solutions there, but nano is simple and easy to use.
        The next brick house on the left
        Intel i7 11th Gen | 16GB | 1TB | KDE Plasma 5.27.11​| Kubuntu 24.04 | 6.8.0-31-generic



        Comment


          #5
          Like Snowhog said, kate will work fine, just don't try to start it as root (with sudo or by other means, this isn't necessary anymore)...If it doesn't have write permission when you save the file, it will ask for your password to temporarily elevate it's write privileges (so you can save files to where you normally don't have access to).

          Comment


            #6
            Originally posted by jglen490 View Post
            ...time to move on....nano is simple and easy to use...
            Yup. Me exactly. I'm rather tired of the "don't know how to you use VI (or VIM)?" Yes I know how, but I'm not stuck in 1978. I know how to manually roll down a car window too but I'm still buying cars with power windows. I think my new retort will be "Well, some of us learn new things and some of us don't", LOL.

            Please Read Me

            Comment

            Working...
            X