My transition from Mepis 11 to Kubuntu 14.04 ongoing, I'm trying to make my Konsole windows look the way I'm used to. In Mepis, my prompt is white when I'm ordinary user, and changes to red when I become root with su (a subtle, non-distracting reminder that I'm in "hose yourself with a wrong keystroke" mode). Knowing (or thinking I knew) that this is a setting controlled by the .bashrc file in the user folder, I copied that file from my Mepis home folder to the corresponding location in the Kubuntu install. No change. I looked inside the file, and uncommented the line that the comments said to release to allow a color prompt. Now I have color; the user@system part of the prompt is green and the current directory portion is bluish -- but both change to plain white when I become root (I've activate the root account password and made it the default for kdesu and sudo, again making Kubuntu work the way I'm used to from Mepis). There has to be another file that controls how the prompt changes when my privilege changes -- where is it?
Announcement
Collapse
No announcement yet.
Copying .bashrc changes nothing?
Collapse
This topic is closed.
X
X
-
Short answer, "/root/.bashrc".
The bash prompt is controlled by the PS1 shell variable, which is typically set in your .bashrc, but can be set where you like. It can contain other shell expressions, including the $( ) construct which can be used to run arbitrary commands. I use it to run a shell function which outputs a trimmed version of the current directory.
If I run sudo -i, the .bashrc in /root is sourced, but I long ago trampled all over that. I prefer using sudoedit or prefixing with sudo, or root actions in dolphin these days.Regards, John Little
- Top
- Bottom
Comment
-
edit the /root/.bashrc file and add in the following, preferably commenting out the existing lines that set the color, though you can simply add this line to the end of the file.
Code:PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
One thing to remember KDE in Mepis 11 never worked 100%, and a lot of the commands used are out of date, a good example is the command used to open Dolphin as root, "kdesu dolphin" while it may work some of the time it will not work all the time,
use
Code:kdesu debus-launch dolphin
- Top
- Bottom
Comment
-
Originally posted by Danum View Post...
use
Code:kdesu debus-launch dolphin
[ATTACH=CONFIG]5115[/ATTACH]
Code:$ [console]kdesu debus-launch dolphin[/console] [I]kdesu: command not found[/I] $ [console]kdesudo debus-launch dolphin[/console] [I]Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon [/I] $ [console]kdesudo dolphin[/console] [I]Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString) QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. kbuildsycoca4 running... Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath) Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath) QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory QFileSystemWatcher: failed to add paths: /root/.config/ibus/bus Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. QDBusConnection: session D-Bus connection created before QCoreApplication. Application may misbehave. QObject::connect: Cannot connect (null)::resourceScoreUpdated(QString, QString, QString, double) to NepomukPlugin::resourceScoreUpdated(QString, QString, QString, double) QObject::connect: Cannot connect (null)::recentStatsDeleted(QString, int, QString) to NepomukPlugin::deleteRecentStats(QString, int, QString) QObject::connect: Cannot connect (null)::earlierStatsDeleted(QString, int) to NepomukPlugin::deleteEarlierStats(QString, int) kactivitymanagerd(4691)/nepomuk (library): Could not find virtuoso to connect to. Aborting QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed: No such file or directory QFileSystemWatcher: failed to add paths: /root/.kde/share/config/activitymanager-pluginsrc QPixmap::scaled: Pixmap is a null pixmap Object::connect: No such signal org::freedesktop::UPower::DeviceAdded(QDBusObjectPath) Object::connect: No such signal org::freedesktop::UPower::DeviceRemoved(QDBusObjectPath) [/I]
"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.
- Top
- Bottom
Comment
-
Originally posted by Danum View Postedit the /root/.bashrc file and add in the following, preferably commenting out the existing lines that set the color, though you can simply add this line to the end of the file.
Code:PS1='${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
One thing to remember KDE in Mepis 11 never worked 100%, and a lot of the commands used are out of date, a good example is the command used to open Dolphin as root, "kdesu dolphin" while it may work some of the time it will not work all the time,
use
Code:kdesu debus-launch dolphin
[ATTACH=CONFIG]5115[/ATTACH]
- Top
- Bottom
Comment
-
Hmm. I, also, find that kdesu debus-launch dolphin fails to launch the file manager from the icon, and when entered at a command line results inCode:kdesu debus-launch dolphin kdesu: command not found
Code:kdesudo debus-launch dolphin Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon kdesudo debus-launch dolphin Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon
- Top
- Bottom
Comment
-
Pan-Galactic QuordlepleenSo Long, and Thanks for All the Fish
- Jul 2011
- 9524
- Seattle, WA, USA
- Send PM
Originally posted by Danum View PostOne thing to remember KDE in Mepis 11 never worked 100%, and a lot of the commands used are out of date, a good example is the command used to open Dolphin as root, "kdesu dolphin" while it may work some of the time it will not work all the time, use
Code:kdesu debus-launch dolphin
Originally posted by GreyGeek View PostThat command never worked for me:
[CODE]$ kdesu debus-launch dolphin
kdesu: command not found
$ kdesudo debus-launch dolphin
Bus:pen: Can not get ibus-daemon's address.
IBusInputContext::createInputContext: no connection to ibus-daemon
Also, the D-Bus invocation is wrong. It should be dbus-launch -- no "e" in "dbus".
Finally, the problems in older versions of KDE that required spawning new D-Bus daemons for elevating programs to root have been solved. It should no longer be necessary to do this. kdesudo dolphin is sufficient.
- Top
- Bottom
Comment
-
Originally posted by Silent Observer View PostHmm. I, also, find that kdesu debus-launch dolphin fails to launch the file manager from the icon, and when entered at a command line results inCode:kdesu debus-launch dolphin kdesu: command not found
Code:kdesudo debus-launch dolphin Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon kdesudo debus-launch dolphin Bus::open: Can not get ibus-daemon's address. IBusInputContext::createInputContext: no connection to ibus-daemon
If you want to run Dolphin as root from Konsole, use the correct commands, in your case enter "su" give the root passwd which will give you a root konsole, then enter "dbus-launch dolphin" and Dolphin will open as root.
What I said about using "kdesu dolphin" was not that it will not open because it will, but, there are some apps that will not function correctly all the time when called using root (kdesu dolphin) namely Kate among others, but by using the correct command "kdesu dbus-launch" dolphin you get no problems, and it has been that way since KDE 4.8. you can look over at the KDE forums there are a lot of threads about it, plus there is one here on the Kubuntu forum.
Below is the dialog you get, the only difference you will have is at the top of the dialog you will have sudo not su as I have, but you still enter the root password,
One thing I would advise you to do is to make the colors of Dolphin different when you open it as root, then there are no mix ups and know exactly what you have open.
As user, System settings > Appearance > Colors, Get new Schemes > Search for kde4 seasons colors and install, then select Summer, which will give you a blue theme when you open Dolphin as user.
Using Krunner open System Settings as root, "kdesu dbus-launch systemsettings"
Appearance > Colors, Get new Schemes > Search for kde4 seasons colors and install, then select Autumm, which will give you a different theme when you open Dolphin as root.
Last edited by Danum; Jul 28, 2014, 02:50 AM.
- Top
- Bottom
Comment
-
Originally posted by Danum View PostWhy are you trying to start Dolphin as root from Konsole, you should be starting it by using Krunner, ( Alt + F2, or by right clicking on the desktop and selecting "Run Command" ) entering "kdesu dbus-launch dolphin" then you will get a dialog asking for your root password
Originally posted by Danum View PostWhat I said about using "kdesu dolphin" was not that it will not open because it will, but, there are some apps that will not function correctly all the time when called using root (kdesu dolphin) namely Kate among others, but by using the correct command "kdesu dbus-launch" dolphin you get no problems, and it has been that way since KDE 4.8. you can look over at the KDE forums there are a lot of threads about it, plus there is one here on the Kubuntu forum.
Originally posted by Danum View PostOne thing I would advise you to do is to make the colors of Dolphin different when you open it as root, then there are no mix ups and know exactly what you have open.
As user, System settings > Appearance > Colors, Get new Schemes > Search for kde4 seasons colors and install, then select Summer, which will give you a blue theme when you open Dolphin as user.
Using Krunner open System Settings as root, "kdesu dbus-launch systemsettings"
- Top
- Bottom
Comment
-
Originally posted by Danum View PostWhy are you trying to start Dolphin as root from Konsole
I'll check the correct "kdesudo dbus-launch dolphin" syntax, and if that works, it'll solve the problem I had with Kate failing to launch from Dophin as su (which I had solved by installing and setting as default text editor the Kwrite -- which appears to be an alias for Kate with some command line options -- that I'm used to using anyway; like Dolphin, it launches repeatedly direct from kdesu/kdesudo without problems). And yes, a quick test shows that using the correct dbus-launch syntax gives a Dolphin as su that can successully launch Kate multiple times.
- Top
- Bottom
Comment
-
Originally posted by Danum View PostOne thing I would advise you to do is to make the colors of Dolphin different when you open it as root, then there are no mix ups and know exactly what you have open.
As user, System settings > Appearance > Colors, Get new Schemes > Search for kde4 seasons colors and install, then select Summer, which will give you a blue theme when you open Dolphin as user.
Using Krunner open System Settings as root, "kdesu dbus-launch systemsettings"
Appearance > Colors, Get new Schemes > Search for kde4 seasons colors and install, then select Autumm, which will give you a different theme when you open Dolphin as root.
Edit: I tried to hit the "thanks" button like I'd do over on the Mepis forum -- and there isn't one. Well, thanks, anyway.
- Top
- Bottom
Comment
-
Pan-Galactic QuordlepleenSo Long, and Thanks for All the Fish
- Jul 2011
- 9524
- Seattle, WA, USA
- Send PM
Originally posted by Silent Observer View PostEdit: I tried to hit the "thanks" button like I'd do over on the Mepis forum -- and there isn't one. Well, thanks, anyway.
- Top
- Bottom
Comment
-
-
Pan-Galactic QuordlepleenSo Long, and Thanks for All the Fish
- Jul 2011
- 9524
- Seattle, WA, USA
- Send PM
Originally posted by jlittle View PostA thanks button would help KFN junkies like me who try to read every post...
If you allow the browser to save your password, and also ensure that you keep the cookie from KFN, then the forum software will keep track of what you have and haven't read. You can click New Posts in the header and get caught up on everything that's new.
- Top
- Bottom
Comment
Comment