Welcome!

The kernel problem with recent updates has been solved. Find the solution here

Important information
-- Required MX 15/16 Repository Changes
-- Information on torrent hosting changes
-- Information on MX15/16 GPG Keys
-- Spectre and Meltdown vulnerabilities

News
-- Introducing our new Website
-- MX Linux on social media: here

Current releases
-- MX-18.3 Point Release release info here
-- Migration Information to MX-18 here
-- antiX-17.4.1 release info here

New users
-- Please read this first, and don't forget to add system and hardware information to posts!
-- Here are the Forum Rules

[Solved] Prompt at the back.

Help for Current Versions of MX
User avatar
Devrandom
Forum Novice
Forum  Novice
Posts: 13
Joined: Sat Aug 10, 2019 4:31 am

[Solved] Prompt at the back.

#1

Post by Devrandom » Sat Aug 10, 2019 5:03 am

Hi all,

I've been a linux user for years and wanted to give MX a go, just to see how it feels being systemd free.
There is one minor thing I would like to alter but I can't seem to figure out how to change it.

I dislike the $ beneath the command prompt, how can I get it back at the end of the line?

Thanks.
Last edited by Devrandom on Sun Aug 11, 2019 1:27 pm, edited 2 times in total.

User avatar
JayM
Qualified MX Guide
Posts: 2144
Joined: Tue Jan 08, 2019 4:47 am

Re: Prompt at the back.

#2

Post by JayM » Sat Aug 10, 2019 5:28 am

Devrandom wrote:
Sat Aug 10, 2019 5:03 am
Hi all,

I've bee a linux user for years and wanted to give MX a go, just to see how it feels being systemd free.
There is one minor thing I would like to alter but I can't seem to figure out how to change it.

I dislike the $ beneath the command prompt, how can I get it back at the end of the line?

Thanks.
Welcome to the forum.

The dollar sign $ is the (default) bash command prompt. A web search shows a lot of sites with instructions for changing and customizing it:
https://duckduckgo.com/?q=change+bash+c ... fnt&ia=web
Have fun! :smile:
Please read How To Ask For Help and How to Break Your System.
MX User Manual: hold down ALT and press F1. Further information may be found in the MX Wiki.

User avatar
Devrandom
Forum Novice
Forum  Novice
Posts: 13
Joined: Sat Aug 10, 2019 4:31 am

Re: Prompt at the back.

#3

Post by Devrandom » Sat Aug 10, 2019 5:55 am

Thanks,

I already found those sites and I've changed everything but the placement of $. :wink:
But, it's okay, I'll try and search some more.

User avatar
Jerry3904
Administrator
Posts: 25796
Joined: Wed Jul 19, 2006 6:13 am

Re: Prompt at the back.

#4

Post by Jerry3904 » Sat Aug 10, 2019 7:19 am

You've already had a great answer to this question on our Facebook Group by Robert Dinse:
The prompt is whatever PS1 is set to. In your .bashrc just set it as desired, export PS1=">" for example.
Not sure ATM how that should look exactly, but will get back to you after a bit of web reading of documents such as this:

https://linoxide.com/how-tos/change-bas ... iable-ps1/
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

User avatar
dolphin_oracle
Developer
Posts: 12576
Joined: Sun Dec 16, 2007 1:17 pm

Re: Prompt at the back.

#5

Post by dolphin_oracle » Sat Aug 10, 2019 7:24 am

Look for a \n in the prompt.definition. \n is "new line"
http://www.youtube.com/runwiththedolphin
lenovo ThinkPad T530 - MX-18.3
lenovo s21e - antiX-19 beta 2 (live-USB)
FYI: mx "test" repo is not the same thing as debian testing repo.

User avatar
Devrandom
Forum Novice
Forum  Novice
Posts: 13
Joined: Sat Aug 10, 2019 4:31 am

Re: Prompt at the back.

#6

Post by Devrandom » Sat Aug 10, 2019 12:43 pm

I found out that I had to look for the \n, and there is one.

Code: Select all

$ echo $PS1
\[\e]0;\u@\h: \w\a\]\[\e[1;35m\]\u\[\e[0m\]@\[\e[1;36m\]\H\[\e[0m\]:\[\e[1;32m\]\w\[\e[0m\]\n\[\e[1;32m\]$\[\e[0m\]
Now I have to find this little man in Bashrc, I guess.

User avatar
Jerry3904
Administrator
Posts: 25796
Joined: Wed Jul 19, 2006 6:13 am

Re: Prompt at the back.

#7

Post by Jerry3904 » Sat Aug 10, 2019 1:04 pm

I tried that. There's only two there (lines 75-78), and it doesn't look like they will help you.

Code: Select all

if [ "$UID" = 0 ]; then
    PS1="$red\u$nc@$red\H$nc:$CYAN\w$nc\\n$red#$nc "
else
    PS1="$PURPLE\u$nc@$CYAN\H$nc:$GREEN\w$nc\\n$GREEN\$$nc "
fi
Haven't followed up on Dinse's code yet...
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

User avatar
Jerry3904
Administrator
Posts: 25796
Joined: Wed Jul 19, 2006 6:13 am

Re: Prompt at the back.

#8

Post by Jerry3904 » Sat Aug 10, 2019 2:52 pm

OK, I copied Dinse's line into my hidden bashrc file just as he wrote it:

Code: Select all

export PS1=">"
Logged out and back in, and I get a very simple Xfce4 Terminal screen.
bashrc1.png
That is clearly the way to go, and you just have to look at the document I linked to get what you want. I might look around a bit more later just for fun.
You do not have the required permissions to view the files attached to this post.
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

User avatar
Jerry3904
Administrator
Posts: 25796
Joined: Wed Jul 19, 2006 6:13 am

Re: Prompt at the back.

#9

Post by Jerry3904 » Sat Aug 10, 2019 3:04 pm

OK, my last post in this thread, the rest is up to you. Having looked at that document, I placed this code in my bashrc file

Code: Select all

\u@\h:\w\$
Those represent username, hostname, the current working directory and the user privilege. In Xfce4 Terminal now I get all in a line:
You do not have the required permissions to view the files attached to this post.
Production: 4.15.0-1-amd64, MX-17.1, AMD FX-4130 Quad-Core, GeForce GT 630/PCIe/SSE2, 8 GB, SSD 120 GB, Data 1TB
Testing: AAO 722: 4.15.0-1-386. MX-17.1, AMD C-60 APU, 4 GB
Personal: XPS 13, 4.18.0-19.3-liquorix, 4 GB

User avatar
malspa
Forum Regular
Forum Regular
Posts: 2037
Joined: Thu Jul 13, 2006 7:21 am

Re: Prompt at the back.

#10

Post by malspa » Sat Aug 10, 2019 3:25 pm

I'm another one who dislikes that default MX prompt. I use a rather simple one; here's the code from my .bashrc file:

Code: Select all

PS1='\[\e[1;32m\]\u[\w]\\$ \[\e[0m\]'
It's really just username, pwd, dollar sign. All on one line, of course.

Image

Post Reply

Return to “MX Help”