Announcement

Collapse
No announcement yet.

howto: run dolphin or muon as root without making a mess ;-]

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

    howto: run dolphin or muon as root without making a mess ;-]

    ohai, KFN

    Playing with my less-than-a-week old plasma5 install one thing I've found made me less than happy is that the three graphical applications I run as root (synaptic, muon and occasionally, dolphin) look horrible. No theming, big ugly fonts - so I did some research.

    Problem is here - https://bugs.debian.org/cgi-bin/bugr...cgi?bug=824906

    and workaround is here - https://bugs.debian.org/cgi-bin/bugr...?bug=824906#10

    kdesu installs in a weird location: /usr/lib/kde4/libexec/kdesu-distrib/kdesu so rather than put that in my path I just symlinked to the executable, like this:

    Code:
    cd /usr/bin
    
    sudo ln -s /usr/lib/kde4/libexec/kdesu-distrib/kdesu kdesu
    Note that the next command will alter the way kdesu works (we do this to preserve the environment), so if you have a root password I'd skip this step:

    Code:
    kwriteconfig5 --file kdesurc --group  super-user-command --key super-user-command sudo
    kdesurc is written to ~/.config if you ever need to find it.

    I use keyboard shortcuts to launch both because I don't need them often, but command lines to start them are

    Code:
    kdesu dbus-launch muon
    Code:
    kdesu dbus-launch dolphin
    If you ever want to revert the changes just delete the symlink we put in /usr/bin and the kdesurc in ~/.config

    Still playing with it, but muon and dolphin are now themed with the same theme I use and font size is correct. synaptic is unchanged, so there may be a GTK3 tweak I can make, but it's been stubborn - which is why I installed muon

    Hope this helps someone else -
    Last edited by wizard10000; Jun 04, 2016, 05:33 PM.
    we see things not as they are, but as we are.
    -- anais nin

    #2
    Alternatively, you can edit sudoers config to make kdesudo (and sudo) keep the important environment variables (see instructions here: https://www.kubuntuforums.net/showth...l=1#post386823), after which apps run with kdesudo will take root's theming and icons (and root's theming can be set by running "kdesudo systemsettings"...in most cases using a different color-scheme, for example, is a good way to visually identify super-user apps).

    Also, using "dbus-launch" is a bit dirty, because it starts a new dbus-daemon (for root) every time it's run (and they keep running even if you close the app), so you could end up having dozens of them running if you use it often. if you have new enough dbus, it's cleaner to use "dbus-run-session" instead ("kdesudo dbus-run-session dolphin"). It also starts a new dbus-daemon, but this daemon exits once you close the app.
    Last edited by kubicle; Jun 04, 2016, 07:21 PM.

    Comment


      #3
      Originally posted by kubicle View Post
      root's theming can be set by running "kdesudo systemsettings"
      Not so here. On my 16.04 'fully updated/dist-upgraded', attempting to run kdesudo systemsettings simply fails to run. I'm prompted for my password, but entering it and pressing Enter simply results in a failure; I hear the Plasma Error tone and that's it. Even running the command in a Konsole fails and displays no messages.
      Last edited by Snowhog; Jun 04, 2016, 08:10 PM.
      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


        #4
        Originally posted by Snowhog View Post
        Not so here. On my 16.04 'fully updated/dist-upgraded', attempting to run kdesudo systemsettings simply fails to run. I'm prompted for my password, but entering it and pressing Enter simply results in a failure; I hear the Plasma Error tone and that's it. Even running the command in a Konsole fails and displays no messages.
        But, when I run kdesudo systemsettings5 I get the SystemSettings panel in all its GUI glory!

        Dolphin works using kdesudo in a konsole as well, and it displays exactly as I set it when I first ran it as root.
        "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
        – John F. Kennedy, February 26, 1962.

        Comment


          #5
          Originally posted by GreyGeek View Post
          But, when I run kdesudo systemsettings5 I get the SystemSettings panel in all its GUI glory!

          Dolphin works using kdesudo in a konsole as well, and it displays exactly as I set it when I first ran it as root.
          Oh, THAT works! Butt ugly fonts in the System Settings window, and there are no icons except for Search and KDE Connect. Hmm.
          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


            #6
            Originally posted by kubicle View Post
            Alternatively, you can edit sudoers config to make kdesudo (and sudo) keep the important environment variables (see instructions here: https://www.kubuntuforums.net/showth...l=1#post386823), after which apps run with kdesudo will take root's theming and icons (and root's theming can be set by running "kdesudo systemsettings"...in most cases using a different color-scheme, for example, is a good way to visually identify super-user apps).

            Also, using "dbus-launch" is a bit dirty, because it starts a new dbus-daemon (for root) every time it's run (and they keep running even if you close the app), so you could end up having dozens of them running if you use it often. if you have new enough dbus, it's cleaner to use "dbus-run-session" instead ("kdesudo dbus-run-session dolphin"). It also starts a new dbus-daemon, but this daemon exits once you close the app.
            The method you outlined works better than the one I did - can someone move this thread out of howtos and into a discussion area, please?

            thanks -

            edit:: fixing kdesudo didn't survive a reboot. Although theming worked I got the dreaded protocol error. Here's where I ended up after re-symlinking kdesu into /usr/bin

            Code:
            kdesu dbus-launch --exit-with-session dolphin
            Last edited by wizard10000; Jun 05, 2016, 06:41 AM.
            we see things not as they are, but as we are.
            -- anais nin

            Comment


              #7
              Originally posted by GreyGeek View Post
              But, when I run kdesudo systemsettings5
              Thanks for that correction, my bad


              Originally posted by Snowhog View Post
              Oh, THAT works! Butt ugly fonts in the System Settings window, and there are no icons except for Search and KDE Connect. Hmm.
              That's were the first part of the fix comes in:
              Alternatively, you can edit sudoers config to make kdesudo (and sudo) keep the important environment variables (see instructions here: https://www.kubuntuforums.net/showth...l=1#post386823), after which apps run with kdesudo will take root's theming and icons
              (that will fix icons and theming for root apps)


              Originally posted by wizard10000 View Post
              edit:: fixing kdesudo didn't survive a reboot. Although theming worked I got the dreaded protocol error.
              You still need to use dbus-activation for dolphin if you wish to avoid that in all cases (even with the "theming-and-icons-with-kde-environment-variables-fix" )
              Originally posted by wizard10000 View Post
              Code:
              kdesu dbus-launch --exit-with-session dolphin
              Somewhat better than just dbus-launch, but still not ideal. This should close the dbus-daemons when you log out (but not when you close the app...like "dbus-run-session" does).
              Last edited by kubicle; Jun 05, 2016, 10:10 AM.

              Comment


                #8
                Originally posted by kubicle View Post
                ...Somewhat better than just dbus-launch, but still not ideal. This should close the dbus-daemons when you log out (but not when you close the app...like "dbus-run-session" does).
                i can see now where I was a little thickheaded there - thank you. I'm still not 100% sure I've got it right but I'm thinking
                Code:
                kdesu dbus-run-session dolphin
                is where I want to be.

                Now that I understand what did work I need to deep dive and figure out *why* it worked and what I need to do next time I need to ask a favor of dbus.

                Thanks again, kubicle
                we see things not as they are, but as we are.
                -- anais nin

                Comment


                  #9
                  Originally posted by wizard10000 View Post
                  Code:
                  kdesu dbus-run-session dolphin
                  is where I want to be.
                  That should work fine, if you prefer to use kdesu (instead of kdesudo) and have linked /usr/bin/kdesu to the "real" kdesu.

                  but "kdesudo dbus-run-session dolphin" should work equally fine for those that prefer kdesudo (to kdesu), provided one has fixed the theming/icons for root.

                  Comment


                    #10
                    Originally posted by kubicle View Post
                    That should work fine, if you prefer to use kdesu (instead of kdesudo) and have linked /usr/bin/kdesu to the "real" kdesu.

                    but "kdesudo dbus-run-session dolphin" should work equally fine for those that prefer kdesudo (to kdesu), provided one has fixed the theming/icons for root.
                    Maybe I'm missing it here, but didn't we have to alter default behavior of sudo to get kdesudo to work? That's the reason I rolled back changes to sudo and decided to use kdesu instead. I just symlinked kdesu into /usr/bin since it was in a weird location
                    we see things not as they are, but as we are.
                    -- anais nin

                    Comment


                      #11
                      Originally posted by wizard10000 View Post
                      Maybe I'm missing it here, but didn't we have to alter default behavior of sudo to get kdesudo to work?
                      Yes...that's why I said "provided one has fixed the theming/icons for root" (which is the edit on sudoers that we did).

                      Comment


                        #12
                        Ah. This forum really needs a like button
                        we see things not as they are, but as we are.
                        -- anais nin

                        Comment


                          #13
                          When we switched to vBulletin, we opted not to use the Reputation feature, or to install similar 'Thumbs Up / Thumbs Down' or 'Thanks' MODs. They just get overused/abused, both in the positive and the negative.
                          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


                            #14
                            Originally posted by Snowhog View Post
                            When we switched to vBulletin, we opted not to use the Reputation feature, or to install similar 'Thumbs Up / Thumbs Down' or 'Thanks' MODs. They just get overused/abused, both in the positive and the negative.
                            Yeah, I went through the same pain with my own board (which I no longer own or run - gave it away to someone a couple years ago). I eventually disabled the entire system after the umpteenth public argument about red pips - I did end up finding a like/dislike hack on vbulletin.org and only implemented the "like" part of the hack. Decided all we needed was positive reinforcement

                            Not recommending we install hacks here, though.
                            we see things not as they are, but as we are.
                            -- anais nin

                            Comment


                              #15
                              Originally posted by Snowhog View Post
                              When we switched to vBulletin, we opted not to use the Reputation feature, or to install similar 'Thumbs Up / Thumbs Down' or 'Thanks' MODs. They just get overused/abused, both in the positive and the negative.
                              +1 I Agree with those decisions.
                              Kubuntu 24.11 64bit under Kernel 6.11.0, Hp Pavilion, 6MB ram. Stay away from all things Google...

                              Comment

                              Working...
                              X