bash prompts

User avatar
rust collector
Motörhead
Posts: 536
Joined: Mon Jan 13, 2014 3:56 pm
Location: no_nb

Re: bash prompts

Unread post by rust collector » Fri Mar 07, 2014 2:07 pm

Right, it does only show a ">" in the terminal window.
This gives me plenty of space to type stuff, even on a little netbook.
The name, and location goes in the top bar of the terminal.
Or as in my case, using dwm, it goes in the...eh..top bar of the wm.
Attachments
2014-03-07-140513_1024x600_scrot.png
2014-03-07-140513_1024x600_scrot.png (11.06 KiB) Viewed 7323 times

User avatar
wuxmedia
Grasshopper
Posts: 6447
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: bash prompts

Unread post by wuxmedia » Fri Mar 07, 2014 2:11 pm

^ I like that, looks like that terminal on Jurassic Park 8) - nice having the user up in the bar.
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: bash prompts

Unread post by machinebacon » Fri Mar 07, 2014 3:34 pm

Oh I see, rusty -- this is the problem if somebody (me) uses spectrwm without <class> or <window> names in the bar. Great idea!
..gnutella..

User avatar
rust collector
Motörhead
Posts: 536
Joined: Mon Jan 13, 2014 3:56 pm
Location: no_nb

Re: bash prompts

Unread post by rust collector » Fri Mar 07, 2014 3:36 pm

Yea, I see the problem there...
I will add a small comment about it, if anyone wants to try it, in the post.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: bash prompts

Unread post by machinebacon » Fri Mar 07, 2014 3:40 pm

Thinking aloud: it should be possible to let it be shown in dwm's upper corner (where usually dwm-6.0 sits), via xsetroot. Or into conky or xrootconsole or osd_cat... probably harder than just that.
..gnutella..

User avatar
rust collector
Motörhead
Posts: 536
Joined: Mon Jan 13, 2014 3:56 pm
Location: no_nb

Re: bash prompts

Unread post by rust collector » Fri Mar 07, 2014 3:49 pm

I would think a scripting guru could do that (meaning not me at the moment, even if I will try)
But why would you want to have the location your terminal "is at" up there all the time? what if you have more terminals open?

As it is, you see where the focused terminal is. I dunno if it would be possible to sort that in the root window, conky and so on?

User avatar
kexolino
Common Boob
Posts: 557
Joined: Sun Jun 16, 2013 1:57 pm

Re: bash prompts

Unread post by kexolino » Fri Mar 07, 2014 4:19 pm

Code: Select all

PS1="$HC$FWHT┌─╼$FMAG[$FCYN\u$FMAG]$HC$FWHT╾─╼$FMAG[$FCYN\w$FMAG]$HC$FWHT\n└─╼$RS "
This is just a variation of what I've been using for two years now... Should note that so far it didn't look right in any other terminal than urxvt (the ╾─╼ part).
Oh yeah, should include this.
Attachments
2014-03-07-161557_1280x1024_scrot.png
2014-03-07-161557_1280x1024_scrot.png (379 Bytes) Viewed 7404 times

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: bash prompts

Unread post by machinebacon » Fri Mar 07, 2014 4:36 pm

rust collector wrote:I would think a scripting guru could do that (meaning not me at the moment, even if I will try)
But why would you want to have the location your terminal "is at" up there all the time? what if you have more terminals open?

As it is, you see where the focused terminal is. I dunno if it would be possible to sort that in the root window, conky and so on?
As I wrote before, just thinking aloud. Shit like this is more about a proof of concept than any additional value, so no worries. The thing is that I am not a fan of additional panels, but I also hate conky. So, the healthiest idea would be a script that replaces the window border _and_ the sysinfo and time/date, much like Unity did. In case of more than one active terminal it would display the path of the active or prelighted one. So something like what the tmux powerline does, exactly, just on the root window.
..gnutella..

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: bash prompts

Unread post by rhowaldt » Fri Mar 07, 2014 5:49 pm

rust collector wrote:I would think a scripting guru could do that (meaning not me at the moment, even if I will try)
a good project is the start of any autodidactic learning experience. you do not honestly know you cannot do it, you just think you can't, because you never did it before. if you try it, the worst that can happen is you learn a whole bunch of cool stuff. the best is you will be able to finish the project and be more aware of your own abilities. you still definitely won't be a guru, but you will have some nice experience under your belt and something to share with your friends here.

just to be clear (Dutchclaimer, inserted as a result of personal experience):
the above is meant as superfriendly and honest encouragement.
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
rust collector
Motörhead
Posts: 536
Joined: Mon Jan 13, 2014 3:56 pm
Location: no_nb

Re: bash prompts

Unread post by rust collector » Fri Mar 07, 2014 6:12 pm

Oh yes, I do agree.
My biggest problem, when I am trying to learn...well...anything, is that I have no real goal to work towards.
I do want to learn bash scripting, but I am not quite authistic enough to just read the book of bash, and know it all.

I do need small projects to tinker with.

Thanks for your superfriendly encouragement. (That is what I thought it was)

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: bash prompts

Unread post by dkeg » Fri Mar 07, 2014 6:39 pm

Another reason I love this place and you guys. For the 'I bet there is or could be another way' attitude. Fuck yeah guys! Great stuff.

Work hard; Complain less

User avatar
wuxmedia
Grasshopper
Posts: 6447
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: bash prompts

Unread post by wuxmedia » Fri Mar 07, 2014 9:23 pm

rust collector wrote:Oh yes, I do agree.
My biggest problem, when I am trying to learn...well...anything, is that I have no real goal to work towards.
I do want to learn bash scripting,
I feel the same, I need some goal to motivate me to write a script.
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: bash prompts

Unread post by Sector11 » Mon Jun 23, 2014 9:10 pm

I'm actually here because of wuxmedia's post mentioning SidBang ... and got cruising around...

So I figured ... leave something behind ...

Code: Select all

export PS1="${cal} \n \$(date +%d) \$(date +%h) \$(date +%y) $yellow| $light_blue\$(date +%T) $no_color\w\n    $light_blue\\$ $no_color"
Image
Of course it's noobish ... none of the (sample)

Code: Select all

\[\e]2;\u@\H \w\a\e[32;1m\]>\[\e[0m\]
code I see in other prompts :/
Last edited by Sector11 on Mon Jun 23, 2014 10:51 pm, edited 1 time in total.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: bash prompts

Unread post by machinebacon » Mon Jun 23, 2014 10:25 pm

That's cute of you ;) Welcome back S11!
..gnutella..

User avatar
wuxmedia
Grasshopper
Posts: 6447
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: bash prompts

Unread post by wuxmedia » Mon Jun 23, 2014 10:33 pm

They seem to be working you hard over at crunchcentral S11! you must be working through a backlog, my post was 4 months old 8)
More of a 'mention' than an advert 8p
"Seek, and Ye shall find"
"Github | Chooons | Site"

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: bash prompts

Unread post by Sector11 » Mon Jun 23, 2014 10:34 pm

^ thanks ...

OT: BBQ-Summer seems to have forgotten my password as well as root's ... guess my fingers were playing hop-scotch on the keyboard with some config files and I made an Oops! hahahahahaha ... Oh well, it's a process.

re-installing again :)
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: bash prompts

Unread post by Sector11 » Mon Jun 23, 2014 10:51 pm

wuxmedia wrote:They seem to be working you hard over at crunchcentral S11! you must be working through a backlog, my post was 4 months old 8)
More of a 'mention' than an advert 8p
Yea, spammers are coming online by the dozen it seems, so it's busy. A post today in another thread linked to that "thread" so I read the whole thing as I know someone that has no DVD drive or USB. And you're right, "a mention", not 'advertising' ... big difference.

I shall edit my post.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

User avatar
dkeg
Configurator
Posts: 3782
Joined: Sun Nov 18, 2012 9:23 pm
Location: Mid-Atlantic Grill

Re: bash prompts

Unread post by dkeg » Mon Jun 23, 2014 10:58 pm

Hi S11! Hey, whatever suits your needs right?

Anyway, bash prompts, here's the one I've been using for awhile

Code: Select all

>>

Work hard; Complain less

User avatar
Sector11
Sperminator
Posts: 193
Joined: Mon Aug 19, 2013 4:15 am

Re: bash prompts

Unread post by Sector11 » Tue Jun 24, 2014 12:32 am

^ which only goes to show that at times: simple is elegant.
I am THE resident noob, hands down no discussion. ... and
I wear my soap on a rope.

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: bash prompts

Unread post by pidsley » Tue Jun 24, 2014 2:02 am

Sector11 wrote:re-installing again :)
Next time don't reinstall; you will never learn anything that way.

Post Reply